Class CC_OperationParameter

java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<ValueType,BoundType>
org.apache.sis.internal.jaxb.gco.PropertyType<CC_OperationParameter,org.opengis.parameter.ParameterDescriptor<?>>
org.apache.sis.internal.jaxb.referencing.CC_OperationParameter

public final class CC_OperationParameter extends PropertyType<CC_OperationParameter,org.opengis.parameter.ParameterDescriptor<?>>
JAXB adapter mapping implementing class to the GeoAPI interface. See package documentation for more information about JAXB and interface.

This class tries also to resolve another difficulty: our implementation class needs to know the base class of values, but this information is not provided in the XML documents. We have to infer it from the actual value.

Since:
0.6
Version:
1.3
  • Field Details

    • valueClass

      public Class<?> valueClass
      The class of the value of the enclosing <gml:ParameterValue> element, or null if unknown.

      This is set by the private beforeMarshal(…) method at unmarshalling time and read by the DefaultParameterDescriptor default constructor.

    • valueDomain

      public MeasurementRange<?> valueDomain
      The domain of values of the enclosing <gml:ParameterValue> element, or null if unknown. If non-null, typically only the unit of measurement is relevant in this object.

      This is set by the private beforeUnmarshal(…) method at unmarshalling time and read by the DefaultParameterDescriptor default constructor.

  • Constructor Details

    • CC_OperationParameter

      public CC_OperationParameter()
      Empty constructor for JAXB only.
    • CC_OperationParameter

      private CC_OperationParameter(org.opengis.parameter.ParameterDescriptor<?> parameter)
  • Method Details

    • getBoundType

      protected Class<org.opengis.parameter.ParameterDescriptor<?>> getBoundType()
      Returns the GeoAPI interface which is bound by this adapter. This method is indirectly invoked by the private constructor below, so it shall not depend on the state of this object.
      Specified by:
      getBoundType in class PropertyType<CC_OperationParameter,org.opengis.parameter.ParameterDescriptor<?>>
      Returns:
      ParameterDescriptor.class
    • wrap

      protected CC_OperationParameter wrap(org.opengis.parameter.ParameterDescriptor<?> parameter)
      Invoked by PropertyType at marshalling time for wrapping the given value in a <gml:OperationParameter> XML element.
      Specified by:
      wrap in class PropertyType<CC_OperationParameter,org.opengis.parameter.ParameterDescriptor<?>>
      Parameters:
      parameter - the element to marshal.
      Returns:
      a PropertyType wrapping the given the element.
    • getElement

      public DefaultParameterDescriptor<?> getElement()
      Invoked by JAXB at marshalling time for getting the actual element to write inside the <gml:OperationParameter> XML element. This is the value or a copy of the value given in argument to the wrap method.
      Returns:
      the element to be marshalled.
    • setElement

      public void setElement(DefaultParameterDescriptor<?> parameter)
      Invoked by JAXB at unmarshalling time for storing the result temporarily.
      Parameters:
      parameter - the unmarshalled element.
    • valueClass

      public static Class<?> valueClass(org.opengis.parameter.ParameterValue<?> param)
      Returns the base class of parameter values, or null if unknown. This method assumes that the parameter value does not yet have a descriptor (which happens at GML unmarshalling time) and that the type must be derived from the actual value.
      Parameters:
      param - the parameter from which to get the value class.
      Returns:
      base class of values, or null if unknown.
    • valueDomain

      public static MeasurementRange<?> valueDomain(org.opengis.parameter.ParameterValue<?> param)
      Saves the unit of measurement in a boundless range. This method should be invoked only when valueClass is Double or double[]. It is the case in a well-formed GML.
      Parameters:
      param - the parameter from which to get the unit of measurement.
      Returns:
      unit of measurement wrapped in a boundless range, or null if none.
    • beforeUnmarshal

      private void beforeUnmarshal(Unmarshaller unmarshaller, Object parent)
      Invoked by JAXB during unmarshalling of the enclosing <gml:OperationParameter>, before the child DefaultParameterDescriptor. This method stores the class and the unit of measurement of the parameter descriptor to create. Those information will be used by the DefaultParameterDescriptor private constructor.
      Parameters:
      unmarshaller - the unmarshaller.
      parent - the enclosing ParameterValue instance being unmarshalled.
    • afterUnmarshal

      private void afterUnmarshal(Unmarshaller unmarshaller, Object parent)
      Clears the value class and units of measurement after <gml:OperationParameter> unmarshalling for avoiding that those information are wrongly used for an unrelated ParameterDescriptor.