Package org.geotools.filter
Class FilterAttributeExtractor
Object
DefaultFilterVisitor
FilterAttributeExtractor
- All Implemented Interfaces:
ExpressionVisitor
,FilterVisitor
- Direct Known Subclasses:
MetaBufferEstimator
,MultipleValueExtractor
,StyleAttributeExtractor
A simple visitor that extracts every attribute used by a filter or an expression
Access 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
FieldsModifier and TypeFieldDescriptionLast set visitedprotected SimpleFeatureType
feature type to evaluate againstprotected Set<PropertyName>
protected boolean
protected boolean
-
Constructor Summary
ConstructorsConstructorDescriptionJust 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
Modifier and TypeMethodDescriptionvoid
clear()
Resets the attributes found so that a new attribute search can be performedString[]
Array of attribute names found (so far).Attributes names found (so far).Lists the PropertyNames found so far; useful when dealing with cpath expressions involving namespace informaiton.boolean
Returns true if the last visited expression is a constant, that is, does not depend on any attribute and does not use anyVolatileFunction
boolean
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 usevisit
(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 Details
-
attributeNames
Last set visited -
propertyNames
-
usingVolatileFunctions
protected boolean usingVolatileFunctions -
usingDynamicProperties
protected boolean usingDynamicProperties -
featureType
feature type to evaluate against
-
-
Constructor Details
-
FilterAttributeExtractor
public FilterAttributeExtractor()Just extract the property names; don't check against a feature type. -
FilterAttributeExtractor
Use the provided feature type as a sanity check when extracting property names.
-
-
Method Details
-
getAttributeNameSet
Attributes names found (so far).- Returns:
- an unmofiable set of the attribute names found so far during the visit
-
getPropertyNameSet
Lists the PropertyNames found so far; useful when dealing with cpath expressions involving namespace informaiton. -
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
- Specified by:
visit
in interfaceExpressionVisitor
- Overrides:
visit
in classDefaultFilterVisitor
-
visit
- 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
-