Package org.geotools.filter
Class FilterAttributeExtractor
- Object
-
- DefaultFilterVisitor
-
- FilterAttributeExtractor
-
- All Implemented Interfaces:
ExpressionVisitor
,FilterVisitor
- Direct Known Subclasses:
MetaBufferEstimator
,MultipleValueExtractor
,StyleAttributeExtractor
public class FilterAttributeExtractor extends DefaultFilterVisitor
A simple visitor that extracts every attribute used by a filter or an expressionAccess to this class is available via:
- DataUtilities.attributeNames( Filter )
- DataUtilities.attributeNames( Filter, FeatureType )
- DataUtilities.attributeNames( Expression )
- DataUtilities.attributeNames( Expression, FeatureType )
isConstantExpression()
method- Author:
- Andrea Aime - GeoSolutions
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<String>
attributeNames
Last set visitedprotected SimpleFeatureType
featureType
feature type to evaluate againstprotected Set<PropertyName>
propertyNames
protected boolean
usingDynamicProperties
protected boolean
usingVolatileFunctions
-
Constructor Summary
Constructors Constructor Description FilterAttributeExtractor()
Just extract the property names; don't check against a feature type.FilterAttributeExtractor(SimpleFeatureType featureType)
Use the provided feature type as a sanity check when extracting property names.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Resets the attributes found so that a new attribute search can be performedString[]
getAttributeNames()
Array of attribute names found (so far).Set<String>
getAttributeNameSet()
Attributes names found (so far).Set<PropertyName>
getPropertyNameSet()
Lists the PropertyNames found so far; useful when dealing with cpath expressions involving namespace informaiton.boolean
isConstantExpression()
Returns true if the last visited expression is a constant, that is, does not depend on any attribute and does not use anyVolatileFunction
boolean
isUsingDynamincProperties()
Returns true if the expression is using dynamic property names, so a static analysis of the expression won't be able to return all the properties in useObject
visit(Function expression, Object data)
Object
visit(PropertyName expression, Object data)
-
Methods inherited from class DefaultFilterVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitNullFilter
-
-
-
-
Field Detail
-
propertyNames
protected Set<PropertyName> propertyNames
-
usingVolatileFunctions
protected boolean usingVolatileFunctions
-
usingDynamicProperties
protected boolean usingDynamicProperties
-
featureType
protected SimpleFeatureType featureType
feature type to evaluate against
-
-
Constructor Detail
-
FilterAttributeExtractor
public FilterAttributeExtractor()
Just extract the property names; don't check against a feature type.
-
FilterAttributeExtractor
public FilterAttributeExtractor(SimpleFeatureType featureType)
Use the provided feature type as a sanity check when extracting property names.
-
-
Method Detail
-
getAttributeNameSet
public Set<String> getAttributeNameSet()
Attributes names found (so far).- Returns:
- an unmofiable set of the attribute names found so far during the visit
-
getPropertyNameSet
public Set<PropertyName> getPropertyNameSet()
Lists the PropertyNames found so far; useful when dealing with cpath expressions involving namespace informaiton.
-
getAttributeNames
public String[] getAttributeNames()
Array of attribute names found (so far).- Returns:
- an array of the attribute names found so far during the visit
-
clear
public void clear()
Resets the attributes found so that a new attribute search can be performed
-
visit
public Object visit(PropertyName expression, Object data)
- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classDefaultFilterVisitor
-
visit
public Object visit(Function expression, Object data)
- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classDefaultFilterVisitor
-
isConstantExpression
public boolean isConstantExpression()
Returns true if the last visited expression is a constant, that is, does not depend on any attribute and does not use anyVolatileFunction
-
isUsingDynamincProperties
public boolean isUsingDynamincProperties()
Returns true if the expression is using dynamic property names, so a static analysis of the expression won't be able to return all the properties in use
-
-