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 StringHolds all sub filters of this filter.protected booleanConfigures 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 SimpleFeatureTypeUsed 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.protectedConstructor with the schema for this attribute.protectedAttributeExpressionImpl(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.booleanCompares this filter to the specified object.Gets the value of this property from the passed object.<T> TGets 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.inthashCode()Override of hashCode method.booleanGets lenient propertyvoidsetLenient(boolean lenient) Sets lenient property.voidsetPropertyName(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:PropertyNameReturns namespace context information, or null if unavailable/inapplicable- Specified by:
getNamespaceContextin 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:
getPropertyNamein interfacePropertyName
-
setPropertyName
-
evaluate
Gets the value of this property from the passed object.- Specified by:
evaluatein interfaceExpression- Overrides:
evaluatein 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:
evaluatein interfaceExpression- Overrides:
evaluatein 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:
acceptin 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
-