Class FeatureChainedAttributeVisitor.FeatureChainedAttributeDescriptor

  • Enclosing class:
    FeatureChainedAttributeVisitor

    public static class FeatureChainedAttributeVisitor.FeatureChainedAttributeDescriptor
    extends Object
    Descriptor class holding information about a feature chained attribute, i.e. an attribute belonging to a feature type that is linked to a root feature type via feature chaining.

    In more detail, purpose of this class is to store:

    1. the sequence of nested attribute mappings describing how from top to bottom in the feature types chain
    2. the path of the attribute, relative to the last linked feature type in the chain (except when the last chaining is done by reference, in which case the path refers to the second last feature type)
    Author:
    Stefano Costa, GeoSolutions
    • Method Detail

      • getLink

        public FeatureChainedAttributeVisitor.FeatureChainLink getLink​(int linkIdx)
        Gets a link in the feature types chain by its index.
        Parameters:
        linkIdx - the link index (0-based)
        Returns:
        the feature chain link corresponding to the provided index
        Throws:
        IllegalArgumentException - if linkIdx is negative
        IndexOutOfBoundsException - if linkIdx is >= than the chain size
      • getFirstLink

        public FeatureChainedAttributeVisitor.FeatureChainLink getFirstLink()
        Gets the first link in the feature types chain.
        Returns:
        the first feature chain link
        Throws:
        IndexOutOfBoundsException - if the feature types chain is empty
      • getLastLink

        public FeatureChainedAttributeVisitor.FeatureChainLink getLastLink()
        Gets the last link in the feature types chain.
        Returns:
        the last feature chain link
        Throws:
        IndexOutOfBoundsException - if the feature types chain is empty
      • isJoiningEnabled

        public boolean isJoiningEnabled()
        Checks whether all nested attribute mappings are instances of JoiningNestedAttributeMapping.
        Returns:
        true if all nested attribute mappings in the chain support joining, false otherwise
      • chainSize

        public int chainSize()
        Gets the size of the feature types chain.
        Returns:
        the number of links in the chain
      • getAttributePath

        public XPathUtil.StepList getAttributePath()
        Gets the path of the feature chained attribute.
        Returns:
        the attribute path
      • setAttributePath

        public void setAttributePath​(XPathUtil.StepList attributePath)
        Sets the path of the feature chained attribute.
        Parameters:
        attributePath - the attribute path to set
      • getFeatureTypeOwningAttribute

        public FeatureTypeMapping getFeatureTypeOwningAttribute()
        Returns the feature type where the mapping configuration of the nested attribute is defined.

        In practice, this is the last linked feature type in the chain, except when the last chaining is done by reference (via an xlink:href attribute), in which case the second last feature type is returned.