org.apache.slide.search.basic.expression
Class ComparePropertyExpression
java.lang.Object
org.apache.slide.search.basic.expression.BasicExpression
org.apache.slide.search.basic.expression.GenericBasicExpression
org.apache.slide.search.basic.expression.CompareExpression
org.apache.slide.search.basic.expression.ComparePropertyExpression
- All Implemented Interfaces:
- IBasicExpression
- Direct Known Subclasses:
- CheckResourceTypeExpression, EQExpression, GTEExpression, GTExpression, IsDefinedExpression, LTEExpression, LTExpression, PropContainsExpression
- public abstract class ComparePropertyExpression
- extends CompareExpression
Abstract base class for compare expressions (GT, EQ, is-collection ...).
- Version:
- $Revision: 1.4 $
Method Summary |
protected abstract boolean |
compare(ComparableResource item)
The concrete CompareExpression must overwrite this. |
protected java.lang.String |
getLiteral(org.jdom.Element e)
extracs the value of of an expression |
protected java.lang.String |
toString(java.lang.String op)
String representation for debugging purposes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
comparedProperty
protected ComparedProperty comparedProperty
ComparePropertyExpression
public ComparePropertyExpression(org.jdom.Element e,
ComparableResourcesPool requestedResourcesPool,
boolean expectLiteral)
throws InvalidQueryException
- Creates a compare expression according to Element e
- Parameters:
e
- jdom element, that describes the expressionrequestedResourcesPool
- the pool of resources to apply the expression to.expectLiteral
- indicates if a <literal> is expected.
ComparePropertyExpression
protected ComparePropertyExpression(org.jdom.Element e,
ComparableResourcesPool requestedResourcesPool,
ComparedProperty comparedProperty)
throws InvalidQueryException
- Creates a compare expression according to Element e
- Parameters:
e
- jdom element, that describes the expressionrequestedResourcesPool
- the pool of resources to apply the expression to.comparedProperty
- the property to compare.
compare
protected abstract boolean compare(ComparableResource item)
- The concrete CompareExpression must overwrite this.
- Specified by:
compare
in class CompareExpression
- Parameters:
item
- one BasicDataItem out of pool
- Returns:
- a boolean
toString
protected java.lang.String toString(java.lang.String op)
- String representation for debugging purposes.
- Returns:
- this expression as String
getLiteral
protected java.lang.String getLiteral(org.jdom.Element e)
throws InvalidQueryException
- extracs the value of of an expression
- Parameters:
e
- an Expression
- Returns:
- the literal as string
- Throws:
InvalidQueryException
- if no found in e