Package org.esa.snap.core.gpf.descriptor
Class AnnotationParameterDescriptor
- java.lang.Object
-
- org.esa.snap.core.gpf.descriptor.AnnotationParameterDescriptor
-
- All Implemented Interfaces:
DataElementDescriptor
,ElementDescriptor
,ParameterDescriptor
public class AnnotationParameterDescriptor extends Object implements ParameterDescriptor
AParameterDescriptor
implementation for theParameter
annotation.- Since:
- BEAM 5
-
-
Constructor Summary
Constructors Constructor Description AnnotationParameterDescriptor(String name, Class<?> dataType, boolean isDeprecated, Parameter annotation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAlias()
Parameter
getAnnotation()
String
getCondition()
Gets a conditional expression which must returntrue
in order to indicate that the parameter value is valid, e.g.Class<? extends Converter>
getConverterClass()
A converter to be used to convert a text to the parameter value and vice versa.Class<?>
getDataType()
String
getDefaultValue()
Gets the parameter's default value.String
getDescription()
Class<? extends DomConverter>
getDomConverterClass()
A converter to be used to convert an (XML) DOM to the parameter value and vice versa.String
getFormat()
Gets a format string to which a textual parameter value must match in order to indicate a valid value, e.g.String
getInterval()
Gets the valid interval for numeric parameters, e.g.String
getItemAlias()
String
getLabel()
String
getName()
String
getPattern()
Gets a regular expression pattern to which a textual parameter value must match in order to indicate a valid value, e.g.Class<? extends RasterDataNode>
getRasterDataNodeClass()
Specifies whichRasterDataNode
subclass of the source products is used to fill theParameterDescriptor.getValueSet()
for this parameter.ParameterDescriptor[]
getStructureMemberDescriptors()
String
getUnit()
Class<? extends Validator>
getValidatorClass()
A validator to be used to validate a parameter value.String[]
getValueSet()
Gets the set of values which can be assigned to a parameter field.boolean
isDeprecated()
Is the parameter marked as deprecated?boolean
isNotEmpty()
Parameter value must not be an empty string?boolean
isNotNull()
Parameter value must not benull
?boolean
isStructure()
-
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in interfaceElementDescriptor
- Returns:
- The symbolic name used to unambiguously identify this element. E.g. the fully qualified name of a Java class.
-
getDataType
public Class<?> getDataType()
- Specified by:
getDataType
in interfaceDataElementDescriptor
- Returns:
- The element's data type.
Defaults to
Object
.
-
getAnnotation
public Parameter getAnnotation()
-
getAlias
public String getAlias()
- Specified by:
getAlias
in interfaceElementDescriptor
- Returns:
- A short form of the symbolic name, or
null
if not declared.
-
getItemAlias
public String getItemAlias()
- Specified by:
getItemAlias
in interfaceParameterDescriptor
- Returns:
- An alias name for the elements of a parameter array. Forces element-wise array conversion from and to DOM representation. Defaults to the empty string (= not set).
-
getDefaultValue
public String getDefaultValue()
Description copied from interface:ParameterDescriptor
Gets the parameter's default value. The default value set is given as a textual representations of the actual value. The framework creates the actual value set by converting the text value to an object using the associatedConverter
.- Specified by:
getDefaultValue
in interfaceParameterDescriptor
- Returns:
- The default value. Defaults to the empty string (= not set).
- See Also:
ParameterDescriptor.getConverterClass()
-
getLabel
public String getLabel()
- Specified by:
getLabel
in interfaceElementDescriptor
- Returns:
- A human-readable version of the symbolic name to be used in user interfaces, or
null
if not declared.
-
getUnit
public String getUnit()
- Specified by:
getUnit
in interfaceParameterDescriptor
- Returns:
- The parameter physical unit. Defaults to the empty string (= not set).
-
getDescription
public String getDescription()
- Specified by:
getDescription
in interfaceElementDescriptor
- Returns:
- A short description, or
null
if not declared.
-
getValueSet
public String[] getValueSet()
Description copied from interface:ParameterDescriptor
Gets the set of values which can be assigned to a parameter field. The value set is given as textual representations of the actual values. The framework creates the actual value set by converting each text value to an object value using the associatedConverter
.- Specified by:
getValueSet
in interfaceParameterDescriptor
- Returns:
- The value set. Defaults to empty array (= not set).
- See Also:
ParameterDescriptor.getConverterClass()
-
getInterval
public String getInterval()
Description copied from interface:ParameterDescriptor
Gets the valid interval for numeric parameters, e.g."[10,20)"
: in the range 10 (inclusive) to 20 (exclusive).- Specified by:
getInterval
in interfaceParameterDescriptor
- Returns:
- The valid interval. Defaults to empty string (= not set).
-
getCondition
public String getCondition()
Description copied from interface:ParameterDescriptor
Gets a conditional expression which must returntrue
in order to indicate that the parameter value is valid, e.g."value > 2.5"
.- Specified by:
getCondition
in interfaceParameterDescriptor
- Returns:
- A conditional expression. Defaults to empty string (= not set).
-
getPattern
public String getPattern()
Description copied from interface:ParameterDescriptor
Gets a regular expression pattern to which a textual parameter value must match in order to indicate a valid value, e.g."a*"
.- Specified by:
getPattern
in interfaceParameterDescriptor
- Returns:
- A regular expression pattern. Defaults to empty string (= not set).
- See Also:
Pattern
-
getFormat
public String getFormat()
Description copied from interface:ParameterDescriptor
Gets a format string to which a textual parameter value must match in order to indicate a valid value, e.g."yyyy-MM-dd HH:mm:ss.Z"
.- Specified by:
getFormat
in interfaceParameterDescriptor
- Returns:
- A format string. Defaults to empty string (= not set).
- See Also:
Format
-
isNotNull
public boolean isNotNull()
Description copied from interface:ParameterDescriptor
Parameter value must not benull
?- Specified by:
isNotNull
in interfaceParameterDescriptor
- Returns:
true
, if so. Defaults tofalse
.
-
isNotEmpty
public boolean isNotEmpty()
Description copied from interface:ParameterDescriptor
Parameter value must not be an empty string?- Specified by:
isNotEmpty
in interfaceParameterDescriptor
- Returns:
true
, if so. Defaults tofalse
.
-
isDeprecated
public boolean isDeprecated()
Description copied from interface:ParameterDescriptor
Is the parameter marked as deprecated?- Specified by:
isDeprecated
in interfaceParameterDescriptor
- Returns:
true
, if so. Defaults tofalse
.
-
getValidatorClass
public Class<? extends Validator> getValidatorClass()
Description copied from interface:ParameterDescriptor
A validator to be used to validate a parameter value.- Specified by:
getValidatorClass
in interfaceParameterDescriptor
- Returns:
- The validator class.
-
getConverterClass
public Class<? extends Converter> getConverterClass()
Description copied from interface:ParameterDescriptor
A converter to be used to convert a text to the parameter value and vice versa.- Specified by:
getConverterClass
in interfaceParameterDescriptor
- Returns:
- The converter class.
-
getDomConverterClass
public Class<? extends DomConverter> getDomConverterClass()
Description copied from interface:ParameterDescriptor
A converter to be used to convert an (XML) DOM to the parameter value and vice versa.- Specified by:
getDomConverterClass
in interfaceParameterDescriptor
- Returns:
- The DOM converter class.
-
getRasterDataNodeClass
public Class<? extends RasterDataNode> getRasterDataNodeClass()
Description copied from interface:ParameterDescriptor
Specifies whichRasterDataNode
subclass of the source products is used to fill theParameterDescriptor.getValueSet()
for this parameter.- Specified by:
getRasterDataNodeClass
in interfaceParameterDescriptor
- Returns:
- The raster data node type.
-
isStructure
public boolean isStructure()
- Specified by:
isStructure
in interfaceParameterDescriptor
- Returns:
true
if the parameter type is a composite data structure.- See Also:
DataElementDescriptor.getDataType()
,ParameterDescriptor.getStructureMemberDescriptors()
-
getStructureMemberDescriptors
public ParameterDescriptor[] getStructureMemberDescriptors()
- Specified by:
getStructureMemberDescriptors
in interfaceParameterDescriptor
- Returns:
- The descriptors for the structure members of this parameter type. The returned array will be empty, if this parameter doesn't have a structure data type.
- See Also:
DataElementDescriptor.getDataType()
,ParameterDescriptor.isStructure()
-
-