Class CC_OperationParameterGroup

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

public final class CC_OperationParameterGroup extends PropertyType<CC_OperationParameterGroup,org.opengis.parameter.ParameterDescriptorGroup>
JAXB adapter mapping implementing class to the GeoAPI interface. See package documentation for more information about JAXB and interface.
Since:
0.6
Version:
0.6
  • Constructor Details

    • CC_OperationParameterGroup

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

      private CC_OperationParameterGroup(org.opengis.parameter.ParameterDescriptorGroup parameter)
  • Method Details

    • getBoundType

      protected Class<org.opengis.parameter.ParameterDescriptorGroup> 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_OperationParameterGroup,org.opengis.parameter.ParameterDescriptorGroup>
      Returns:
      ParameterDescriptorGroup.class
    • wrap

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

      public DefaultParameterDescriptorGroup 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(DefaultParameterDescriptorGroup parameter)
      Invoked by JAXB at unmarshalling time for storing the result temporarily.
      Parameters:
      parameter - the unmarshalled element.
    • merge

      public static org.opengis.parameter.GeneralParameterDescriptor[] merge(List<org.opengis.parameter.GeneralParameterDescriptor> descriptors, org.opengis.parameter.GeneralParameterDescriptor[] fromValues, Map<org.opengis.parameter.GeneralParameterDescriptor,org.opengis.parameter.GeneralParameterDescriptor> replacements)
      Invoked by DefaultParameterDescriptorGroup.setDescriptors(GeneralParameterDescriptor[]) for merging into a single set the descriptors which are repeated twice in a GML document.

      The descriptors argument gives the descriptors listed explicitly inside a <gml:OperationParameterGroup> or <gml:OperationMethod> element. Those descriptors are said "incomplete" (from SIS point of view) because they are missing the ParameterDescriptor.getValueClass() property, which does not exist in GML but is mandatory for us. However, an exception to this "incompleteness" happen when SIS has been able to match the <gml:OperationMethod> parent to one of the predefined operations in the org.apache.sis.internal.referencing.provider package.

      The fromValues argument gives the descriptors declared in each <gml:ParameterValue> instances of a <gml:ParameterValueGroup> or <gml:AbstractSingleOperation> element. Contrarily to the descriptors argument, the fromValues instances should have non-null ParameterDescriptor.getValueClass() property inferred by SIS from the parameter value.

      So the preferred descriptors from more complete to less complete are:

      1. descriptors if and only if they contain predefined parameters inferred by SIS from the <gml:OperationMethod> name.
      2. fromValues, which contain the descriptors declared in the <gml:ParameterValue> instances.
      3. descriptors, which contain the descriptor listed in <gml:OperationParameterGroup> or <gml:OperationMethod>.
      Note: this code is defined in this CC_OperationParameterGroup class instead of in the DefaultParameterDescriptorGroup class in the hope to reduce the amount of code processed by the JVM in the common case where JAXB (un)marshalling is not needed.
      Parameters:
      descriptors - the descriptors declared in the ParameterDescriptorGroup.
      fromValues - the descriptors declared in the ParameterValue instances. They are said "valid" because they contain the mandatory valueClass property.
      replacements - an IdentityHashMap where to store the replacements that the caller needs to apply in the GeneralParameterValue instances.
      Returns:
      a sequence containing the merged set of parameter descriptors.
      See Also:
    • verifyEquivalence

      private static void verifyEquivalence(String name, boolean condition)
      Throws an exception for mismatched descriptor if a condition is false. This is used for verifying that a descriptors has the expected properties.