net.sf.basedb.core
Class ItemParameterType<T extends BasicItem>
java.lang.Object
net.sf.basedb.core.ParameterType<T>
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) $
Methods inherited from class net.sf.basedb.core.ParameterType |
getDefaultValue, getEnumeration, getHeight, getItems, getMultiplicity, getNotNull, getParameterClass, getValueType, getWidth, isEnumeration, validate, validate |
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 accepteditems
- List of items to choose from.
ItemParameterType
public ItemParameterType(Class<T> clazz,
T defaultValue,
boolean notNull,
int multiplicity,
List<T> items)
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 exceptionvalue
- 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>