Package org.geotools.filter.visitor
Class IsStaticExpressionVisitor
- Object
-
- IsStaticExpressionVisitor
-
- All Implemented Interfaces:
ExpressionVisitor
public class IsStaticExpressionVisitor extends Object implements ExpressionVisitor
Check if an expression is static (ie does not contain a PropertyName expression).This visitor will "short-circuit" the moment it finds a PropertyName expression and will not need to visit the entire data structure.
Example:
if( filter.accepts( IsStaticExpressionVisitor.VISITOR, null ) ){ Color color = expression.evaulate( null, Color.class ); ... }
- Author:
- Jody
-
-
Field Summary
Fields Modifier and Type Field Description static IsStaticExpressionVisitor
VISITOR
-
Constructor Summary
Constructors Modifier Constructor Description protected
IsStaticExpressionVisitor()
visit each expression and check that they are static
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
visit(Add expression, Object data)
visit each expression and check that they are staticBoolean
visit(Divide expression, Object data)
visit each expression and check that they are staticBoolean
visit(Function expression, Object data)
Visit each parameter and check if they are staticBoolean
visit(Literal expression, Object data)
Literal expressions are always static.Boolean
visit(Multiply expression, Object data)
visit each expression and check that they are static.Boolean
visit(NilExpression expression, Object data)
visit each expression and check that they are staticBoolean
visit(PropertyName expression, Object data)
If even a single PropertyName is found in the expression the expression is not static.Boolean
visit(Subtract expression, Object data)
visit each expression and check that they are static.
-
-
-
Field Detail
-
VISITOR
public static final IsStaticExpressionVisitor VISITOR
-
-
Method Detail
-
visit
public Boolean visit(NilExpression expression, Object data)
visit each expression and check that they are static- Specified by:
visit
in interfaceExpressionVisitor
- Returns:
- implementation specific
-
visit
public Boolean visit(Add expression, Object data)
visit each expression and check that they are static- Specified by:
visit
in interfaceExpressionVisitor
-
visit
public Boolean visit(Divide expression, Object data)
visit each expression and check that they are static- Specified by:
visit
in interfaceExpressionVisitor
-
visit
public Boolean visit(Function expression, Object data)
Visit each parameter and check if they are static- Specified by:
visit
in interfaceExpressionVisitor
-
visit
public Boolean visit(Literal expression, Object data)
Literal expressions are always static.- Specified by:
visit
in interfaceExpressionVisitor
- Returns:
- true
-
visit
public Boolean visit(Multiply expression, Object data)
visit each expression and check that they are static.- Specified by:
visit
in interfaceExpressionVisitor
- Returns:
- true if getExpression1 and getExpression2 are static
-
visit
public Boolean visit(PropertyName expression, Object data)
If even a single PropertyName is found in the expression the expression is not static.- Specified by:
visit
in interfaceExpressionVisitor
- Returns:
- false
-
visit
public Boolean visit(Subtract expression, Object data)
visit each expression and check that they are static.- Specified by:
visit
in interfaceExpressionVisitor
- Returns:
- true if getExpression1 and getExpression2 are static
-
-