public abstract class ParameterType<T> extends Object
ParameterType
is used by objects that take some kind of parameter input from an user.Modifier and Type | Method and Description |
---|---|
T |
getDefaultValue()
Get the default value.
|
int |
getHeight()
Get the height of the input field for the parameter in the GUI.
|
List<T> |
getItems()
Get the list of item data objects to choose from.
|
int |
getMultiplicity()
Get how many values that can be tied to this
parameter. 0 is unlimited values and 1 is default.
|
boolean |
getNotNull()
Check if the parameter can be null.
|
Class<T> |
getParameterClass()
Get the class a value must have to match this parameter type.
|
int |
getWidth()
Get the width of the input field in the GUI.
|
boolean |
isEnumeration()
Check if the parameter type enumerates the allowed values
or not.
|
void |
validate(String name,
List<?> values)
Check if a list of values contain invalid values.
|
void |
validate(String name,
Object value)
Check if a value is valid according to the settings of this parameter type.
|
public Class<T> getParameterClass()
public int getHeight()
public int getWidth()
public boolean getNotNull()
public int getMultiplicity()
public T getDefaultValue()
public void validate(String name, Object value) throws InvalidDataException
name
- The name of the parameter, used for better exception messagesvalue
- The value to testInvalidDataException
- If the value is invalidpublic void validate(String name, List<?> values) throws InvalidDataException
values
- A list of objects to checkInvalidDataException
- If the list contains too many values as
specified by the getMultiplicity()
setting or has invalid values
as checked by validate(String, Object)
public boolean isEnumeration()
getItems()