Package org.geotools.data.complex.filter
Class FeatureChainedAttributeVisitor.FeatureChainedAttributeDescriptor
- Object
-
- 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:
- the sequence of nested attribute mappings describing how from top to bottom in the feature types chain
- 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLink(FeatureChainedAttributeVisitor.FeatureChainLink chainLink)
Adds a new link in the feature types chain.int
chainSize()
Gets the size of the feature types chain.XPathUtil.StepList
getAttributePath()
Gets the path of the feature chained attribute.List<FeatureChainedAttributeVisitor.FeatureChainLink>
getFeatureChain()
Returns the list of links in the feature types chain.FeatureTypeMapping
getFeatureTypeOwningAttribute()
Returns the feature type where the mapping configuration of the nested attribute is defined.FeatureChainedAttributeVisitor.FeatureChainLink
getFirstLink()
Gets the first link in the feature types chain.FeatureChainedAttributeVisitor.FeatureChainLink
getLastLink()
Gets the last link in the feature types chain.FeatureChainedAttributeVisitor.FeatureChainLink
getLink(int linkIdx)
Gets a link in the feature types chain by its index.boolean
isJoiningEnabled()
Checks whether all nested attribute mappings are instances ofJoiningNestedAttributeMapping
.void
setAttributePath(XPathUtil.StepList attributePath)
Sets the path of the feature chained attribute.FeatureChainedAttributeVisitor.FeatureChainedAttributeDescriptor
shallowCopy()
Perform a shallow copy of thisFeatureChainedAttributeVisitor.FeatureChainedAttributeDescriptor
instance.
-
-
-
Method Detail
-
getFeatureChain
public List<FeatureChainedAttributeVisitor.FeatureChainLink> getFeatureChain()
Returns the list of links in the feature types chain.- Returns:
- a copy of the internal feature chain links list
-
addLink
public void addLink(FeatureChainedAttributeVisitor.FeatureChainLink chainLink)
Adds a new link in the feature types chain.- Parameters:
chainLink
- the link to add
-
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
- iflinkIdx
is negativeIndexOutOfBoundsException
- iflinkIdx
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 ofJoiningNestedAttributeMapping
.- 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.
-
shallowCopy
public FeatureChainedAttributeVisitor.FeatureChainedAttributeDescriptor shallowCopy()
Perform a shallow copy of thisFeatureChainedAttributeVisitor.FeatureChainedAttributeDescriptor
instance.- Returns:
- a shallow copy of the instance
-
-