2.17.2: 2011-06-17

net.sf.basedb.core
Class ItemParameterType<T extends BasicItem>

java.lang.Object
  extended by net.sf.basedb.core.ParameterType<T>
      extended by net.sf.basedb.core.ItemParameterType<T>

public class ItemParameterType<T extends BasicItem>
extends ParameterType<T>

This class represent a parameter type that is an object derived from BasicData. It will have a list of BasicItem derived objects of the same type to choose from.

Version:
2.0
Author:
Samuel, Nicklas
Last modified
$Date: 2010-10-01 13:51:57 +0200 (Fri, 01 Oct 2010) $

Constructor Summary
ItemParameterType(Class<T> clazz, List<T> items)
          Create a new item parameter type, allowing null values.
ItemParameterType(Class<T> clazz, T defaultValue, boolean notNull, int multiplicity, List<T> items)
           
 
Method Summary
(package private)  ItemParameterValueData newParameterValueData()
          Create a new ItemParameterValueData object.
 String toString()
           
(package private)  void validateValue(String name, T value)
          Check if the value is in the list of allowed values.
 
Methods inherited from class net.sf.basedb.core.ParameterType
getDefaultValue, getEnumeration, getHeight, getItems, getMultiplicity, getNotNull, getParameterClass, getValueType, getWidth, isEnumeration, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ItemParameterType

public ItemParameterType(Class<T> clazz,
                         List<T> items)
Create a new item parameter type, allowing null values.

Parameters:
clazz - The class object of the type of items that are accepted
items - List of items to choose from.

ItemParameterType

public ItemParameterType(Class<T> clazz,
                         T defaultValue,
                         boolean notNull,
                         int multiplicity,
                         List<T> items)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

validateValue

void validateValue(String name,
                   T value)
             throws InvalidDataException
Check if the value is in the list of allowed values.

Specified by:
validateValue in class ParameterType<T extends BasicItem>
Parameters:
name - The name of the parameter, use the name if there is need to throw an exception
value - The value
Throws:
InvalidDataException - If the value is not valid

newParameterValueData

ItemParameterValueData newParameterValueData()
Create a new ItemParameterValueData object.

Specified by:
newParameterValueData in class ParameterType<T extends BasicItem>

2.17.2: 2011-06-17