Class FeatureTypeMapping

  • Direct Known Subclasses:
    XmlFeatureTypeMapping

    public class FeatureTypeMapping
    extends Object
    Since:
    2.4
    Author:
    Gabriel Roldan (Axios Engineering), Rini Angreani (CSIRO Earth Science and Resource Engineering)
    • Method Detail

      • getFeatureIdExpression

        public Expression getFeatureIdExpression()
      • getAttributeMappingsIgnoreIndex

        public List<AttributeMapping> getAttributeMappingsIgnoreIndex​(XPathUtil.StepList targetPath)
        Finds the attribute mappings for the given target location path. If the exactPath is not indexed, it will get all the matching mappings ignoring index. If it is indexed, it will get the one with matching index only.
      • getAttributeMappingsByExpression

        public List<AttributeMapping> getAttributeMappingsByExpression​(Expression sourceExpression)
        Finds the attribute mappings for the given source expression.
        Returns:
        list of matching attribute mappings
      • getAttributeMapping

        public AttributeMapping getAttributeMapping​(XPathUtil.StepList exactPath)
        Finds the attribute mapping for the target expression exactPath
        Parameters:
        exactPath - the xpath expression on the target schema to find the mapping for
        Returns:
        the attribute mapping that match 1:1 with exactPath or null if
      • getAttributeMapping

        public AttributeMapping getAttributeMapping​(String xpathExpression)
        Finds the attribute mapping for the target expression exactPath.
        Parameters:
        xpathExpression - the xpath expression on the target schema to find the mapping for
        Returns:
        the attribute mapping that match 1:1 with exactPath or null
      • setTargetFeature

        public void setTargetFeature​(AttributeDescriptor feature)
        Has to be called after #setTargetType(FeatureType)
      • setName

        public void setName​(Name name)
      • getMappingName

        public Name getMappingName()
      • getIsListMappings

        public List<AttributeMapping> getIsListMappings()
        Return list of attribute mappings that are configured as list (isList = true).
        Returns:
        attribute mappings with isList enabled.
      • findMappingsFor

        public List<Expression> findMappingsFor​(XPathUtil.StepList propertyName,
                                                boolean includeNestedMappings)
        Looks up for attribute mappings matching the xpath expression propertyName.

        If any step in propertyName has index greater than 1, any mapping for the same property applies, regardless of the mapping. For example, if there are mappings for gml:name[1], gml:name[2] and gml:name[3], but propertyName is just gml:name, all three mappings apply.

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • isDenormalised

        public boolean isDenormalised()
      • setDenormalised

        public void setDenormalised​(boolean isDenormalised)
      • isInclude

        public boolean isInclude()
      • setInclude

        public void setInclude​(boolean isInclude)
      • getDefaultGeometryXPath

        public String getDefaultGeometryXPath()
        Returns the default geometry XPath expression that was specified in the mapping configuration, or null if none was set.
        Returns:
        XPath expression identifying the default geometry property
        See Also:
        setDefaultGeometryXPath(String)
      • setDefaultGeometryXPath

        public void setDefaultGeometryXPath​(String defaultGeometryXPath)
        Specifies which property should be used as default geometry for the target feature type.

        This is especially useful when automatic detection of the default geometry is difficult or impossible to do, e.g. when the geometry property is nested inside another property, or multiple geometry properties are present.

        The specified geometry property may be a direct child of the target feature type, or may be nested inside another property. If the evaluation of the provided expression yields multiple values, an exception will be thrown at runtime.

        Parameters:
        defaultGeometryXPath - XPath expression identifying the default geometry property
      • getIndexAttributeName

        public String getIndexAttributeName​(String xpath)
        Returns index attribute name linked to unrolled propertyName or null if is absent
        Returns:
        Index attribute name
      • getSourceDatastoreId

        public Optional<String> getSourceDatastoreId()
        Returns the source datastore id from mappings configurations.
      • setSourceDatastoreId

        public void setSourceDatastoreId​(String sourceDatastoreId)
        Sets the source datastore id from mappings configurations.