Class DefaultParameterDescriptor

java.lang.Object
org.esa.snap.core.gpf.descriptor.DefaultParameterDescriptor
All Implemented Interfaces:
DataElementDescriptor, ElementDescriptor, ParameterDescriptor
Direct Known Subclasses:
ToolParameterDescriptor

public class DefaultParameterDescriptor extends Object implements ParameterDescriptor
Default implementation of the ParameterDescriptor interface.
Since:
BEAM 5
  • Constructor Details

    • DefaultParameterDescriptor

      public DefaultParameterDescriptor()
    • DefaultParameterDescriptor

      public DefaultParameterDescriptor(String name, Class<?> dataType)
  • Method Details

    • isStructure

      public static boolean isStructure(Class<?> type)
    • isSimple

      public static boolean isSimple(Class<?> type)
    • getDataMemberDescriptors

      public static ParameterDescriptor[] getDataMemberDescriptors(Class<?> dataType)
    • getName

      public String getName()
      Specified by:
      getName in interface ElementDescriptor
      Returns:
      The symbolic name used to unambiguously identify this element. E.g. the fully qualified name of a Java class.
    • setName

      public void setName(String name)
    • getDataType

      public Class<?> getDataType()
      Specified by:
      getDataType in interface DataElementDescriptor
      Returns:
      The element's data type. Defaults to Object.
    • setDataType

      public void setDataType(Class<?> dataType)
    • getAlias

      public String getAlias()
      Specified by:
      getAlias in interface ElementDescriptor
      Returns:
      A short form of the symbolic name, or null if not declared.
    • setAlias

      public void setAlias(String alias)
    • 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 associated Converter.
      Specified by:
      getDefaultValue in interface ParameterDescriptor
      Returns:
      The default value. Defaults to the empty string (= not set).
      See Also:
    • setDefaultValue

      public void setDefaultValue(String defaultValue)
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface ElementDescriptor
      Returns:
      A short description, or null if not declared.
    • setDescription

      public void setDescription(String description)
    • getLabel

      public String getLabel()
      Specified by:
      getLabel in interface ElementDescriptor
      Returns:
      A human-readable version of the symbolic name to be used in user interfaces, or null if not declared.
    • setLabel

      public void setLabel(String label)
    • getUnit

      public String getUnit()
      Specified by:
      getUnit in interface ParameterDescriptor
      Returns:
      The parameter physical unit. Defaults to the empty string (= not set).
    • setUnit

      public void setUnit(String unit)
    • 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 interface ParameterDescriptor
      Returns:
      The valid interval. Defaults to empty string (= not set).
    • setInterval

      public void setInterval(String interval)
    • 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 associated Converter.
      Specified by:
      getValueSet in interface ParameterDescriptor
      Returns:
      The value set. Defaults to empty array (= not set).
      See Also:
    • setValueSet

      public void setValueSet(String[] valueSet)
    • getCondition

      public String getCondition()
      Description copied from interface: ParameterDescriptor
      Gets a conditional expression which must return true in order to indicate that the parameter value is valid, e.g. "value > 2.5".
      Specified by:
      getCondition in interface ParameterDescriptor
      Returns:
      A conditional expression. Defaults to empty string (= not set).
    • setCondition

      public void setCondition(String condition)
    • 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 interface ParameterDescriptor
      Returns:
      A regular expression pattern. Defaults to empty string (= not set).
      See Also:
    • setPattern

      public void setPattern(String 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 interface ParameterDescriptor
      Returns:
      A format string. Defaults to empty string (= not set).
      See Also:
    • setFormat

      public void setFormat(String format)
    • isNotNull

      public boolean isNotNull()
      Description copied from interface: ParameterDescriptor
      Parameter value must not be null?
      Specified by:
      isNotNull in interface ParameterDescriptor
      Returns:
      true, if so. Defaults to false.
    • setNotNull

      public void setNotNull(boolean notNull)
    • isNotEmpty

      public boolean isNotEmpty()
      Description copied from interface: ParameterDescriptor
      Parameter value must not be an empty string?
      Specified by:
      isNotEmpty in interface ParameterDescriptor
      Returns:
      true, if so. Defaults to false.
    • setNotEmpty

      public void setNotEmpty(boolean notEmpty)
    • isDeprecated

      public boolean isDeprecated()
      Description copied from interface: ParameterDescriptor
      Is the parameter marked as deprecated?
      Specified by:
      isDeprecated in interface ParameterDescriptor
      Returns:
      true, if so. Defaults to false.
    • setDeprecated

      public void setDeprecated(boolean deprecated)
    • getRasterDataNodeClass

      public Class<? extends RasterDataNode> getRasterDataNodeClass()
      Description copied from interface: ParameterDescriptor
      Specifies which RasterDataNode subclass of the source products is used to fill the ParameterDescriptor.getValueSet() for this parameter.
      Specified by:
      getRasterDataNodeClass in interface ParameterDescriptor
      Returns:
      The raster data node type.
    • setRasterDataNodeClass

      public void setRasterDataNodeClass(Class<? extends RasterDataNode> rasterDataNodeClass)
    • 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 interface ParameterDescriptor
      Returns:
      The validator class.
    • setValidatorClass

      public void setValidatorClass(Class<? extends Validator> validator)
    • 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 interface ParameterDescriptor
      Returns:
      The converter class.
    • setConverterClass

      public void setConverterClass(Class<? extends Converter> converter)
    • 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 interface ParameterDescriptor
      Returns:
      The DOM converter class.
    • setDomConverterClass

      public void setDomConverterClass(Class<? extends DomConverter> domConverter)
    • getItemAlias

      public String getItemAlias()
      Specified by:
      getItemAlias in interface ParameterDescriptor
      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).
    • setItemAlias

      public void setItemAlias(String itemAlias)
    • isStructure

      public boolean isStructure()
      Specified by:
      isStructure in interface ParameterDescriptor
      Returns:
      true if the parameter type is a composite data structure.
      See Also:
    • getStructureMemberDescriptors

      public ParameterDescriptor[] getStructureMemberDescriptors()
      Specified by:
      getStructureMemberDescriptors in interface ParameterDescriptor
      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: