Class RelationQueryNode
java.lang.Object
org.apache.jackrabbit.spi.commons.query.QueryNode
org.apache.jackrabbit.spi.commons.query.NAryQueryNode<QueryNode>
org.apache.jackrabbit.spi.commons.query.RelationQueryNode
- All Implemented Interfaces:
QueryConstants
Implements a query node that defines property value relation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NameActs as an synthetic placeholder for a location step that matches any name.Fields inherited from class org.apache.jackrabbit.spi.commons.query.QueryNode
TYPE_AND, TYPE_DEREF, TYPE_EXACT, TYPE_LOCATION, TYPE_NODETYPE, TYPE_NOT, TYPE_OR, TYPE_ORDER, TYPE_PATH, TYPE_PROP_FUNCTION, TYPE_RELATION, TYPE_ROOT, TYPE_TEXTSEARCHFields inherited from interface org.apache.jackrabbit.spi.commons.query.QueryConstants
OP_NAME_BETWEEN, OP_NAME_EQ_GENERAL, OP_NAME_EQ_VALUE, OP_NAME_GE_GENERAL, OP_NAME_GE_VALUE, OP_NAME_GT_GENERAL, OP_NAME_GT_VALUE, OP_NAME_IN, OP_NAME_LE_GENERAL, OP_NAME_LE_VALUE, OP_NAME_LIKE, OP_NAME_LT_GENERAL, OP_NAME_LT_VALUE, OP_NAME_NE_GENERAL, OP_NAME_NE_VALUE, OP_NAME_NOT_NULL, OP_NAME_NULL, OP_NAME_SIMILAR, OP_NAME_SPELLCHECK, OP_NAME_UNKNOW, OPERATION_BETWEEN, OPERATION_EQ_GENERAL, OPERATION_EQ_VALUE, OPERATION_GE_GENERAL, OPERATION_GE_VALUE, OPERATION_GT_GENERAL, OPERATION_GT_VALUE, OPERATION_IN, OPERATION_LE_GENERAL, OPERATION_LE_VALUE, OPERATION_LIKE, OPERATION_LT_GENERAL, OPERATION_LT_VALUE, OPERATION_NAMES, OPERATION_NE_GENERAL, OPERATION_NE_VALUE, OPERATION_NOT_NULL, OPERATION_NULL, OPERATION_SIMILAR, OPERATION_SPELLCHECK, OPERATIONS, TYPE_DATE, TYPE_DOUBLE, TYPE_LONG, TYPE_NAME_DATE, TYPE_NAME_DOUBLE, TYPE_NAME_LONG, TYPE_NAME_POSITION, TYPE_NAME_STRING, TYPE_NAME_TIMESTAMP, TYPE_NAME_UNKNOWN, TYPE_NAMES, TYPE_POSITION, TYPE_STRING, TYPE_TIMESTAMP -
Method Summary
Modifier and TypeMethodDescriptionaccept(QueryNodeVisitor visitor, Object data) Accepts aQueryNodeVisitorand calls the appropriatevisitmethod on the visitor depending on the concrete implementation of thisQueryNode.voidaddPathElement(Path.Element element) Adds a path element to the existing relative path.booleanReturnstrueifobjis the same type ofQueryNodeasthisnode and is equal tothisnode.Returns theDatevalue if this relation if of typeQueryConstants.TYPE_DATE.doubleReturns thedoublevalue if this relation if of typeQueryConstants.TYPE_DOUBLE.longReturns thelongvalue if this relation if of typeQueryConstants.TYPE_LONG.intReturns the operation type.intReturns theintposition index value if this relation is of typeQueryConstants.TYPE_POSITION.Returns theStringvalue if this relation if of typeQueryConstants.TYPE_STRING.intgetType()Returns the type of this node.intReturns the type of the value.voidsetDateValue(Date value) Sets a new value of typeDate.voidsetDoubleValue(double value) Sets a new value of typedouble.voidsetLongValue(long value) Sets a new value of typelong.voidsetPositionValue(int value) Sets a new value for the position index.voidsetRelativePath(Path relPath) Sets the relative path to the property in this relation.voidsetStringValue(String value) Sets a new value of typeString.voidsetUnaryMinus(boolean b) Ifbistruethen the value in this relation node contains a receding unary minus.Methods inherited from class org.apache.jackrabbit.spi.commons.query.NAryQueryNode
acceptOperands, addOperand, getNumOperands, getOperands, needsSystemTree, removeOperand
-
Field Details
-
STAR_NAME_TEST
Acts as an synthetic placeholder for a location step that matches any name. This is required because a JCR path does not allow a Name with a single '*' (star) character.
-
-
Method Details
-
accept
Accepts aQueryNodeVisitorand calls the appropriatevisitmethod on the visitor depending on the concrete implementation of thisQueryNode.- Specified by:
acceptin classQueryNode- Parameters:
visitor- the visitor to call back.data- arbitrary data for the visitor.- Returns:
- the return value of the
visitor.visit()call. - Throws:
RepositoryException
-
getType
public int getType()Returns the type of this node. -
setUnaryMinus
public void setUnaryMinus(boolean b) Ifbistruethen the value in this relation node contains a receding unary minus.- Parameters:
b-trueif this relation contains a unary minus.
-
getValueType
public int getValueType()Returns the type of the value.- Returns:
- the type of the value.
-
getRelativePath
- Returns:
- the relative path that references the property in this relation.
-
setRelativePath
Sets the relative path to the property in this relation.- Parameters:
relPath- the relative path to a property.- Throws:
IllegalArgumentException- ifrelPathis absolute.
-
addPathElement
Adds a path element to the existing relative path. To add a path element which matches all node names useSTAR_NAME_TEST.- Parameters:
element- the path element to append.
-
getLongValue
public long getLongValue()Returns thelongvalue if this relation if of typeQueryConstants.TYPE_LONG.- Returns:
- the
longvalue.
-
setLongValue
public void setLongValue(long value) Sets a new value of typelong.- Parameters:
value- the new value.
-
getPositionValue
public int getPositionValue()Returns theintposition index value if this relation is of typeQueryConstants.TYPE_POSITION.- Returns:
- the position index value.
-
setPositionValue
public void setPositionValue(int value) Sets a new value for the position index.- Parameters:
value- the new value.
-
getDoubleValue
public double getDoubleValue()Returns thedoublevalue if this relation if of typeQueryConstants.TYPE_DOUBLE.- Returns:
- the
doublevalue.
-
setDoubleValue
public void setDoubleValue(double value) Sets a new value of typedouble.- Parameters:
value- the new value.
-
getStringValue
Returns theStringvalue if this relation if of typeQueryConstants.TYPE_STRING.- Returns:
- the
Stringvalue.
-
setStringValue
Sets a new value of typeString.- Parameters:
value- the new value.
-
getDateValue
Returns theDatevalue if this relation if of typeQueryConstants.TYPE_DATE.- Returns:
- the
Datevalue.
-
setDateValue
Sets a new value of typeDate.- Parameters:
value- the new value.
-
getOperation
public int getOperation()Returns the operation type.- Returns:
- the operation type.
-
equals
Returnstrueifobjis the same type ofQueryNodeasthisnode and is equal tothisnode.- Overrides:
equalsin classNAryQueryNode<QueryNode>- Parameters:
obj- the reference object with which to compare.- Returns:
trueifobjis equal tothis;falseotherwise.
-