C
- Class typepublic class ObjectListParameter<C> extends ClassListParameter<C>
Modifier and Type | Field and Description |
---|---|
private ArrayList<C> |
instances
Cache for the generated instances.
|
restrictionClass
LIST_SEP, SPLIT, VECTOR_SEP, VECTOR_SPLIT
constraints, defaultValue, givenValue, optionalParameter, optionid, shortDescription
Constructor and Description |
---|
ObjectListParameter(OptionID optionID,
Class<?> restrictionClass)
Constructor for non-optional.
|
ObjectListParameter(OptionID optionID,
Class<?> restrictionClass,
boolean optional)
Constructor with optional flag.
|
Modifier and Type | Method and Description |
---|---|
String |
getSyntax()
Returns a string representation of the parameter's type.
|
List<C> |
instantiateClasses(Parameterization config)
Returns a list of new instances for the value (i.e., the class name) of
this class list parameter.
|
protected List<Class<? extends C>> |
parseValue(Object obj)
Parse a given value into the destination type.
|
getKnownImplementations, getRestrictionClass, getRestrictionClasses, getValueAsString, getValuesDescription, hasValuesDescription, restrictionString, validate
asString, getListSize
addConstraint, getDefaultValue, getDefaultValueAsString, getFullDescription, getGivenValue, getName, getOptionID, getShortDescription, getValue, hasDefaultValue, isDefined, isOptional, isValid, setDefaultValue, setOptional, setShortDescription, setValue, setValueInternal, tookDefaultValue, tryDefaultValue, useDefaultValue
public ObjectListParameter(OptionID optionID, Class<?> restrictionClass, boolean optional)
optionID
- Option IDrestrictionClass
- Restriction classoptional
- optional flagpublic String getSyntax()
getSyntax
in class ClassListParameter<C>
protected List<Class<? extends C>> parseValue(Object obj) throws ParameterException
parseValue
in class ClassListParameter<C>
obj
- Object to parse (may be a string representation!)ParameterException
- when the object cannot be parsed.public List<C> instantiateClasses(Parameterization config)
instantiateClasses
in class ClassListParameter<C>
config
- Parameterization to use (if Parameterizable))