C
- Class typepublic class ObjectListParameter<C> extends ClassListParameter<C>
Modifier and Type | Field and Description |
---|---|
private ArrayList<C> |
instances
Cache for the generated instances.
|
loader, 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, getValueAsString, getValuesDescription, hasValuesDescription, restrictionString, validate
asString, getListSize
addConstraint, addConstraints, 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()
ClassListParameter
protected List<Class<? extends C>> parseValue(Object obj) throws ParameterException
AbstractParameter
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)
ClassListParameter
If the Class for the class names is not found, the instantiation is tried using the package of the restriction class as package of the class name.
instantiateClasses
in class ClassListParameter<C>
config
- Parameterization to use (if Parameterizable))