Package org.geotools.filter
Class AttributeExpressionImpl
Object
ExpressionAbstract
DefaultExpression
AttributeExpressionImpl
- All Implemented Interfaces:
Expression
,PropertyName
- Direct Known Subclasses:
JdbcMultipleValue
,JoinPropertyName
,NestedAttributeExpression
Defines a complex filter (could also be called logical filter). This filter holds one or more filters together and
relates them logically in an internally defined manner.
- Author:
- Rob Hranac, TOPP
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
Holds all sub filters of this filter.protected boolean
Configures whether evaluate should return null if it cannot find a working property accessor, rather than throwing an exception (default behaviour).NamespaceSupport used to defining the prefix information for the xpath expressionprotected SimpleFeatureType
Used to validate attribute references to ensure they match the provided schemaFields inherited from interface Expression
NIL
-
Constructor Summary
ConstructorsModifierConstructorDescriptionAttributeExpressionImpl
(String xpath) Constructor with schema and path to the attribute.AttributeExpressionImpl
(String xpath, Hints hints) AttributeExpressionImpl
(String xpath, NamespaceSupport namespaceContext) Constructor with schema and path to the attribute.protected
Constructor with the schema for this attribute.protected
AttributeExpressionImpl
(SimpleFeatureType schema, String attPath) Constructor with schema and path to the attribute.AttributeExpressionImpl
(Name name) Constructor with full attribute name. -
Method Summary
Modifier and TypeMethodDescriptionaccept
(ExpressionVisitor visitor, Object extraData) Used by FilterVisitors to perform some action on this filter instance.boolean
Compares this filter to the specified object.Gets the value of this property from the passed object.<T> T
Gets the value of this attribute from the passed object.Returns namespace context information, or null if unavailable/inapplicableGets the path to the attribute to be evaluated by this expression.int
hashCode()
Override of hashCode method.boolean
Gets lenient propertyvoid
setLenient
(boolean lenient) Sets lenient property.void
setPropertyName
(String attPath) toString()
Return this expression as a string.Methods inherited from class DefaultExpression
isAttributeExpression, isExpression, isFunctionExpression, isGeometryExpression, isLiteralExpression, isMathExpression
-
Field Details
-
attPath
Holds all sub filters of this filter. -
schema
Used to validate attribute references to ensure they match the provided schema -
namespaceSupport
NamespaceSupport used to defining the prefix information for the xpath expression -
lenient
protected boolean lenientConfigures whether evaluate should return null if it cannot find a working property accessor, rather than throwing an exception (default behaviour).
-
-
Constructor Details
-
AttributeExpressionImpl
Constructor with the schema for this attribute.- Parameters:
schema
- The schema for this attribute.
-
AttributeExpressionImpl
Constructor with schema and path to the attribute.- Parameters:
xpath
- the String xpath to the attribute.
-
AttributeExpressionImpl
Constructor with full attribute name.- Parameters:
name
- Attribute Name.
-
AttributeExpressionImpl
Constructor with schema and path to the attribute.- Parameters:
xpath
- the String xpath to the attribute.namespaceContext
- Defining the prefix information for the xpath expression
-
AttributeExpressionImpl
- Parameters:
xpath
- xpath expressionhints
- Hints passed to the property accessor during evaulation
-
AttributeExpressionImpl
protected AttributeExpressionImpl(SimpleFeatureType schema, String attPath) throws IllegalFilterException Constructor with schema and path to the attribute.- Parameters:
schema
- The initial (required) sub filter.attPath
- the xpath to the attribute.- Throws:
IllegalFilterException
- If the attribute path is not in the schema.
-
-
Method Details
-
getNamespaceContext
Description copied from interface:PropertyName
Returns namespace context information, or null if unavailable/inapplicable- Specified by:
getNamespaceContext
in interfacePropertyName
- Returns:
- namespace context information, or null if unavailable/inapplicable
-
getPropertyName
Gets the path to the attribute to be evaluated by this expression.- Specified by:
getPropertyName
in interfacePropertyName
-
setPropertyName
-
evaluate
Gets the value of this property from the passed object.- Specified by:
evaluate
in interfaceExpression
- Overrides:
evaluate
in classExpressionAbstract
- Parameters:
obj
- Object from which we need to extract a property value.- Returns:
- default implementation returns null
-
evaluate
Gets the value of this attribute from the passed object.- Specified by:
evaluate
in interfaceExpression
- Overrides:
evaluate
in classExpressionAbstract
- Type Parameters:
T
- The type of the returned object.- Parameters:
obj
- Object from which to extract attribute value.target
- Target Class- Returns:
- Evaluates the given expression based on the content of the given object an an instance of
context
.
-
toString
Return this expression as a string. -
equals
Compares this filter to the specified object. Returns true if the passed in object is the same as this expression. Checks to make sure the expression types are the same as well as the attribute paths and schemas. -
hashCode
public int hashCode()Override of hashCode method. -
accept
Used by FilterVisitors to perform some action on this filter instance. Typicaly used by Filter decoders, but may also be used by any thing which needs infomration from filter structure. Implementations should always call: visitor.visit(this); It is importatant that this is not left to a parent class unless the parents API is identical.- Specified by:
accept
in interfaceExpression
- Parameters:
visitor
- The visitor which requires access to this filter, the method must call visitor.visit(this);
-
setLenient
public void setLenient(boolean lenient) Sets lenient property. -
isLenient
public boolean isLenient()Gets lenient property- Returns:
- lenient
-