Class Parameter<T>

java.lang.Object
org.apache.sis.internal.simple.SimpleIdentifiedObject
org.apache.sis.internal.jaxb.metadata.replace.Parameter<T>
Type Parameters:
T - the type of parameter values.
All Implemented Interfaces:
Serializable, LenientComparable, org.opengis.parameter.GeneralParameterDescriptor, org.opengis.parameter.ParameterDescriptor<T>, org.opengis.referencing.IdentifiedObject
Direct Known Subclasses:
QualityParameter, ServiceParameter

abstract class Parameter<T> extends SimpleIdentifiedObject implements org.opengis.parameter.ParameterDescriptor<T>
Base class for ISO/OGC parameter classes replaced by ParameterDescriptor in GeoAPI. GeoAPI tries to provides a single API for the parameter classes defined in various specifications (ISO 19111, ISO 19115, ISO 19157, Web Processing Service). But we still need separated representations at XML (un)marshalling time.

Note that this implementation is simple and serves no other purpose than being a container for XML parsing and formatting. For real parameter framework, consider using org.apache.sis.parameter package instead.

Since:
1.3
Version:
1.3
  • Field Details

    • descriptor

      private transient volatile org.opengis.parameter.ParameterDescriptor<T> descriptor
      A copy of this as a fully-implemented parameter descriptor. This is created when first needed for implementation of createValue(). Should not be created for other purposes — in particular for implementation of getter methods — because it would create an infinite loop in DefaultParameterDescriptor copy constructor.
  • Constructor Details

    • Parameter

      Parameter()
      Creates an initially empty parameter. This constructor is needed by JAXB at unmarshalling time.
    • Parameter

      Parameter(org.opengis.parameter.ParameterDescriptor<T> parameter)
      Creates a parameter with the values of the given descriptor. This is used at marshalling time for converting a generic descriptor to the standard-specific parameter representation defined by subclass.
      Parameters:
      parameter - the parameter to marshal.
  • Method Details

    • getValueType

      public org.opengis.util.TypeName getValueType()
      Returns the name that describes the type of parameter values. The default implementation returns a non-null value only if this class is wrapping another parameter descriptor. Subclasses should override this method for computing a type name if this method returns null.
      Returns:
      the type name of value component(s) in this parameter, or null if unknown.
    • getValueClass

      public Class<T> getValueClass()
      Returns the class that describes the type of parameter values. The default implementation returns a non-null value only if this class is wrapping another parameter descriptor. Subclasses should override this method for computing a class if this method returns null.
      Specified by:
      getValueClass in interface org.opengis.parameter.ParameterDescriptor<T>
      Returns:
      the value class inferred from the attribute type, or null if unknown.
    • createValue

      public final org.opengis.parameter.ParameterValue<T> createValue()
      Creates a new instance of ParameterValue. This method delegates the work to DefaultParameterDescriptor since this ServiceParameter class is not a full-featured parameter descriptor implementation.
      Specified by:
      createValue in interface org.opengis.parameter.GeneralParameterDescriptor
      Specified by:
      createValue in interface org.opengis.parameter.ParameterDescriptor<T>
      Returns:
      a new instance of ParameterValue.
    • getValidValues

      public Set<T> getValidValues()
      Optional properties.
      Specified by:
      getValidValues in interface org.opengis.parameter.ParameterDescriptor<T>
      Returns:
      null.
    • getMinimumValue

      public Comparable<T> getMinimumValue()
      Specified by:
      getMinimumValue in interface org.opengis.parameter.ParameterDescriptor<T>
    • getMaximumValue

      public Comparable<T> getMaximumValue()
      Specified by:
      getMaximumValue in interface org.opengis.parameter.ParameterDescriptor<T>
    • getDefaultValue

      public T getDefaultValue()
      Specified by:
      getDefaultValue in interface org.opengis.parameter.ParameterDescriptor<T>
    • getUnit

      public javax.measure.Unit<?> getUnit()
      Specified by:
      getUnit in interface org.opengis.parameter.ParameterDescriptor<T>
    • equals

      public final boolean equals(Object object, ComparisonMode mode)
      Compares this object with the given one for equality. This implementation should be consistent with AbstractIdentifiedObject.equals(Object) implementation, with the simplification that some Parameter property values are always null.
      Specified by:
      equals in interface LenientComparable
      Overrides:
      equals in class SimpleIdentifiedObject
      Parameters:
      object - the object to compare with this reference system.
      mode - the strictness level of the comparison.
      Returns:
      true if both objects are equal.
      See Also:
    • toString

      private static String toString(org.opengis.metadata.Identifier identifier)
      Null-safe string representation of the given identifier, for comparison purpose. We ignore codespace because they cannot be represented in ISO 19139 XML documents.