public class ParameterSetParser extends Object
Parameters and creates instances of
InstantiableFromParameterSets from a ParameterSet.| Modifier and Type | Class and Description |
|---|---|
static class |
ParameterSetParser.NotInstantiableException
An
Exception that is thrown if an instance of some class could
not be created. |
static class |
ParameterSetParser.WrongParameterTypeException
|
| Constructor and Description |
|---|
ParameterSetParser() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
getBooleanFromParameter(Parameter par)
|
static byte |
getByteFromParameter(Parameter par)
|
static double |
getDoubleFromParameter(Parameter par)
|
static float |
getFloatFromParameter(Parameter par)
|
static <T extends InstantiableFromParameterSet> |
getInstanceFromParameterSet(InstanceParameterSet<T> pars)
Returns an instance of a subclass of
InstantiableFromParameterSet
that can be instantiated by the InstanceParameterSet
pars. |
static <T extends InstantiableFromParameterSet> |
getInstanceFromParameterSet(ParameterSet pars,
Class<T> instanceClass)
Returns an instance of a subclass of
InstantiableFromParameterSet
that can be instantiated by the ParameterSet pars. |
static int |
getIntFromParameter(Parameter par)
|
static long |
getLongFromParameter(Parameter par)
|
static short |
getShortFromParameter(Parameter par)
|
static String |
getStringFromParameter(Parameter par)
|
public static int getIntFromParameter(Parameter par) throws ParameterSetParser.WrongParameterTypeException
par - the Parameterint value of the ParameterParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
int, i.e. its DataType is not
DataType.INTDataType,
DataType.INTpublic static float getFloatFromParameter(Parameter par) throws ParameterSetParser.WrongParameterTypeException
par - the Parameterfloat value of the ParameterParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
float, i.e. its DataType is not
DataType.FLOATDataType,
DataType.FLOATpublic static double getDoubleFromParameter(Parameter par) throws ParameterSetParser.WrongParameterTypeException
par - the Parameterdouble value of the ParameterParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
double, i.e. its DataType is not
DataType.DOUBLEDataType,
DataType.DOUBLEpublic static short getShortFromParameter(Parameter par) throws ParameterSetParser.WrongParameterTypeException
par - the Parametershort value of the ParameterParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
short, i.e. its DataType is not
DataType.SHORTDataType,
DataType.SHORTpublic static long getLongFromParameter(Parameter par) throws ParameterSetParser.WrongParameterTypeException
par - the Parameterlong value of the ParameterParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
long, i.e. its DataType is not
DataType.LONGDataType,
DataType.LONGpublic static byte getByteFromParameter(Parameter par) throws ParameterSetParser.WrongParameterTypeException
par - the Parameterbyte value of the ParameterParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
byte, i.e. its DataType is not
DataType.BYTEDataType,
DataType.BYTEpublic static boolean getBooleanFromParameter(Parameter par) throws ParameterSetParser.WrongParameterTypeException
par - the Parameterboolean value of the ParameterParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
boolean, i.e. its DataType is not
DataType.BOOLEANDataType,
DataType.BOOLEANpublic static String getStringFromParameter(Parameter par) throws ParameterSetParser.WrongParameterTypeException
par - the ParameterString value of the ParameterParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
String, i.e. its DataType is not
DataType.STRINGDataType,
DataType.STRINGpublic static <T extends InstantiableFromParameterSet> T getInstanceFromParameterSet(InstanceParameterSet<T> pars) throws ParameterSetParser.NotInstantiableException
InstantiableFromParameterSet
that can be instantiated by the InstanceParameterSet
pars. The instance class is taken from pars via
the method InstanceParameterSet.getInstanceClass().T - the type of the InstanceParameterSetpars - the InstanceParameterSetParameterSetParser.NotInstantiableException - if InstanceParameterSet.getInstanceClass() of
pars is null, could not be found or
cannot be instantiated from parsInstanceParameterSet.getInstanceClass(),
getInstanceFromParameterSet(ParameterSet, Class)public static <T extends InstantiableFromParameterSet> T getInstanceFromParameterSet(ParameterSet pars, Class<T> instanceClass) throws ParameterSetParser.NotInstantiableException
InstantiableFromParameterSet
that can be instantiated by the ParameterSet pars.
The instance class is taken from instanceClass.T - the type of the InstanceParameterSetpars - the ParameterSetinstanceClass - the class that shall be instantiatedParameterSetParser.NotInstantiableException - if instanceClass is null, could not
be found or cannot be instantiated from pars