Class AttributeMapping

  • All Implemented Interfaces:
    Serializable

    public class AttributeMapping
    extends Object
    implements Serializable
    Configuration object for the mapping of a community schema attribute.
    Since:
    2.4
    Author:
    Gabriel Roldan (Axios Engineering), Rini Angreani (CSIRO Earth Science and Resource Engineering), Russell Petty (GeoScience Victoria)
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean encodeIfEmpty()
      Returns whether this attribute should encode when empty;
      Map<String,​String> getAnonymousAttributes()
      Attribute definition map for anonymous unbounded sequences on complexType Elements.
      Map<String,​String> getClientProperties()  
      String getIdentifierExpression()  
      String getIdentifierPath()  
      String getIndexField()  
      String getInputAttributePath()
      Return the input XPath expression
      String getInstancePath()  
      String getLabel()  
      String getLinkElement()
      Returns the name of the linked element type of which this attribute is nesting/targeting.
      String getLinkField()
      Returns the XPath expression addressing the target attribute in the linked target feature type
      MultipleValue getMultipleValue()  
      String getParentLabel()  
      String getSourceExpression()
      Returns the expression whose evaluation result against a Feature of the source FeatureType is going to be the value of the target attribute in output FeatureType.
      String getSourceIndex()
      Returns the expression whose evaluation result in numeric value to indicate row number to extract {@link this#sourceExpression} from denormalised database rows.
      String getTargetAttributePath()
      Returns the XPath expression addressing the target attribute in a target FeatureType.
      String getTargetAttributeSchemaElement()
      Returns the name of the target element instance this attribute mapping applies to, or null if its fully addressable by the FeatureType.
      String getTargetQueryString()  
      boolean isList()
      Returns whether this attribute should be treated as a list valued property.
      boolean isMultiple()
      Returns whether this attribute should be treated as a single or multi valued property.
      void putAnonymousAttribute​(String name, String expression)  
      void putClientProperty​(String name, String expression)  
      void setAnonymousAttributes​(Map<String,​String> anonymousAttributes)  
      void setClientProperties​(Map<String,​String> clientProperties)  
      void setEncodeIfEmpty​(boolean encodeIfEmpty)
      Returns whether this attribute should encode when empty;
      void setEncodeIfEmpty​(String encodeIfEmpty)
      Returns whether this attribute should encode when empty;
      void setIdentifierExpression​(String identifierExpression)  
      void setIdentifierPath​(String identifierPath)  
      void setIndexField​(String indexField)  
      void setInputAttributePath​(String inputAttributePath)
      Set the input XPath expression where we are getting the features from a data access instead of a data store.
      void setInstancePath​(String instancePath)  
      void setLabel​(String label)  
      void setLinkElement​(String linkElement)
      Sets the name of the linked element type of which this attribute is nesting/targeting.
      void setLinkField​(String linkField)
      Sets the XPath expression addressing the target attribute in the linked target feature type
      void setList​(boolean isList)
      Sets whether this attribute should be treated as a list valued property.
      void setList​(String list)
      Helper method to allow config digester passing a string.
      void setMultiple​(boolean isMultiple)
      Sets whether this attribute should be treated as a single or multi valued property.
      void setMultiple​(String isMultiple)
      Helper method to allow config digester passing a string.
      void setMultipleValue​(MultipleValue multipleValue)  
      void setParentLabel​(String parentLabel)  
      void setSourceExpression​(String sourceExpression)
      Sets the OGC CQL expression for the attribute value.
      void setSourceIndex​(String sourceIndex)
      Sets the OGC CQL expression index for the attribute value.
      void setTargetAttributePath​(String targetAttributePath)
      Sets the XPath expression addressing the target attribute in a target FeatureType.
      void setTargetAttributeSchemaElement​(String targetAttributeSchemaElement)
      Sets the name of the target element instance in the output schema.
      void setTargetQueryString​(String targetQueryString)  
      String toString()
      Returns a string representation of this config object.
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AttributeMapping

        public AttributeMapping()
    • Method Detail

      • getSourceExpression

        public String getSourceExpression()
        Returns the expression whose evaluation result against a Feature of the source FeatureType is going to be the value of the target attribute in output FeatureType.

        At this stage, the expression must be a valid OpenGIS Common Query Language expression.

        Returns:
        OGC CQL expression for the attribute value
      • setSourceExpression

        public void setSourceExpression​(String sourceExpression)
        Sets the OGC CQL expression for the attribute value.
        Parameters:
        sourceExpression - OGC CQL expression for the attribute value.
      • getSourceIndex

        public String getSourceIndex()
        Returns the expression whose evaluation result in numeric value to indicate row number to extract {@link this#sourceExpression} from denormalised database rows.

        At this stage, the expression must be a valid integer, or LAST would work to get the last dynamic result.

        Returns:
        OGC CQL expression for the attribute value
      • setSourceIndex

        public void setSourceIndex​(String sourceIndex)
        Sets the OGC CQL expression index for the attribute value.
        Parameters:
        sourceIndex - OGC CQL expression index for the attribute value.
      • getInputAttributePath

        public String getInputAttributePath()
        Return the input XPath expression
        Returns:
        the input XPath expression
      • setInputAttributePath

        public void setInputAttributePath​(String inputAttributePath)
        Set the input XPath expression where we are getting the features from a data access instead of a data store.
      • getLabel

        public String getLabel()
      • setLabel

        public void setLabel​(String label)
      • getParentLabel

        public String getParentLabel()
      • setParentLabel

        public void setParentLabel​(String parentLabel)
      • getTargetQueryString

        public String getTargetQueryString()
      • setTargetQueryString

        public void setTargetQueryString​(String targetQueryString)
      • getInstancePath

        public String getInstancePath()
      • setInstancePath

        public void setInstancePath​(String instancePath)
      • getIdentifierPath

        public String getIdentifierPath()
      • setIdentifierPath

        public void setIdentifierPath​(String identifierPath)
      • getLinkElement

        public String getLinkElement()
        Returns the name of the linked element type of which this attribute is nesting/targeting.
        Returns:
        the link element name
      • setLinkElement

        public void setLinkElement​(String linkElement)
        Sets the name of the linked element type of which this attribute is nesting/targeting.
      • getLinkField

        public String getLinkField()
        Returns the XPath expression addressing the target attribute in the linked target feature type
        Returns:
        the linked field
      • setLinkField

        public void setLinkField​(String linkField)
        Sets the XPath expression addressing the target attribute in the linked target feature type
      • getTargetAttributePath

        public String getTargetAttributePath()
        Returns the XPath expression addressing the target attribute in a target FeatureType.
        Returns:
        the XPath location path for the target attribute of the mapping.
      • setTargetAttributePath

        public void setTargetAttributePath​(String targetAttributePath)
        Sets the XPath expression addressing the target attribute in a target FeatureType.
        Parameters:
        targetAttributePath - the XPath location path for the target attribute of the mapping.
      • getTargetAttributeSchemaElement

        public String getTargetAttributeSchemaElement()
        Returns the name of the target element instance this attribute mapping applies to, or null if its fully addressable by the FeatureType.

        For example, the target FeatureType may define a property as GeometryAttributeType, but the actual instance should be PointPropertyType. In which case, it should be set to "gml:PointPropertyType" so AppSchemaDataAccess knows it should create a point property an thus its subelements are to be addressable by subsequent mappings.

        Returns:
        name of the target element instance in the output schema or null if not set.
      • setTargetAttributeSchemaElement

        public void setTargetAttributeSchemaElement​(String targetAttributeSchemaElement)
        Sets the name of the target element instance in the output schema.
        Parameters:
        targetAttributeSchemaElement - name of the target element instance in the output schema. Could be prefixed, in which case the prefix mapping has to be available in the corresponding AppSchemaDataAccessDTO.getNamespaces()
      • isMultiple

        public boolean isMultiple()
        Returns whether this attribute should be treated as a single or multi valued property.
        Returns:
        true if this attribute corresponds to a multivalued property, false otherwise.
      • setMultiple

        public void setMultiple​(boolean isMultiple)
        Sets whether this attribute should be treated as a single or multi valued property.
        Parameters:
        isMultiple - true if this attribute corresponds to a multivalued property, false otherwise.
      • encodeIfEmpty

        public boolean encodeIfEmpty()
        Returns whether this attribute should encode when empty;
        Returns:
        true encode when the value is empty, false otherwise.
      • setEncodeIfEmpty

        public void setEncodeIfEmpty​(boolean encodeIfEmpty)
        Returns whether this attribute should encode when empty;
        Parameters:
        encodeIfEmpty - true encode when the value is empty, false otherwise.
      • setEncodeIfEmpty

        public void setEncodeIfEmpty​(String encodeIfEmpty)
        Returns whether this attribute should encode when empty;
        Parameters:
        encodeIfEmpty - true encode when the value is empty, false otherwise.
      • setList

        public void setList​(boolean isList)
        Sets whether this attribute should be treated as a list valued property.
        Parameters:
        isList - true if this attribute corresponds to a list valued property, false otherwise.
      • setList

        public void setList​(String list)
        Helper method to allow config digester passing a string.
        See Also:
        setList(boolean)
      • isList

        public boolean isList()
        Returns whether this attribute should be treated as a list valued property.
        Returns:
        true if this attribute corresponds to a list valued property, false otherwise.
      • setMultiple

        public void setMultiple​(String isMultiple)
        Helper method to allow config digester passing a string.
        See Also:
        setMultiple(boolean)
      • toString

        public String toString()
        Returns a string representation of this config object.
        Overrides:
        toString in class Object
        Returns:
        String representation of this config object.
      • getClientProperties

        public Map<String,​String> getClientProperties()
      • setClientProperties

        public void setClientProperties​(Map<String,​String> clientProperties)
      • putClientProperty

        public void putClientProperty​(String name,
                                      String expression)
      • getIdentifierExpression

        public String getIdentifierExpression()
      • setIdentifierExpression

        public void setIdentifierExpression​(String identifierExpression)
      • setMultipleValue

        public void setMultipleValue​(MultipleValue multipleValue)
      • getIndexField

        public String getIndexField()
      • setIndexField

        public void setIndexField​(String indexField)
      • getAnonymousAttributes

        public Map<String,​String> getAnonymousAttributes()
        Attribute definition map for anonymous unbounded sequences on complexType Elements.
      • setAnonymousAttributes

        public void setAnonymousAttributes​(Map<String,​String> anonymousAttributes)
      • putAnonymousAttribute

        public void putAnonymousAttribute​(String name,
                                          String expression)