Class TreeCompiler
- java.lang.Object
-
- org.apache.commons.jxpath.ri.compiler.TreeCompiler
-
-
Field Summary
Fields Modifier and Type Field Description private static QNameQNAME_NAME-
Fields inherited from interface org.apache.commons.jxpath.ri.Compiler
AXIS_ANCESTOR, AXIS_ANCESTOR_OR_SELF, AXIS_ATTRIBUTE, AXIS_CHILD, AXIS_DESCENDANT, AXIS_DESCENDANT_OR_SELF, AXIS_FOLLOWING, AXIS_FOLLOWING_SIBLING, AXIS_NAMESPACE, AXIS_PARENT, AXIS_PRECEDING, AXIS_PRECEDING_SIBLING, AXIS_SELF, FUNCTION_BOOLEAN, FUNCTION_CEILING, FUNCTION_CONCAT, FUNCTION_CONTAINS, FUNCTION_COUNT, FUNCTION_FALSE, FUNCTION_FLOOR, FUNCTION_FORMAT_NUMBER, FUNCTION_ID, FUNCTION_KEY, FUNCTION_LANG, FUNCTION_LAST, FUNCTION_LOCAL_NAME, FUNCTION_NAME, FUNCTION_NAMESPACE_URI, FUNCTION_NORMALIZE_SPACE, FUNCTION_NOT, FUNCTION_NULL, FUNCTION_NUMBER, FUNCTION_POSITION, FUNCTION_ROUND, FUNCTION_STARTS_WITH, FUNCTION_STRING, FUNCTION_STRING_LENGTH, FUNCTION_SUBSTRING, FUNCTION_SUBSTRING_AFTER, FUNCTION_SUBSTRING_BEFORE, FUNCTION_SUM, FUNCTION_TRANSLATE, FUNCTION_TRUE, NODE_TYPE_COMMENT, NODE_TYPE_NODE, NODE_TYPE_PI, NODE_TYPE_TEXT
-
-
Constructor Summary
Constructors Constructor Description TreeCompiler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectand(java.lang.Object[] arguments)Produces an EXPRESSION object representing logical conjunction of all argumentsjava.lang.Objectdivide(java.lang.Object left, java.lang.Object right)Produces an EXPRESSION object representing left divided by rightjava.lang.Objectequal(java.lang.Object left, java.lang.Object right)Produces an EXPRESSION object representing the comparison: left equals to rightjava.lang.ObjectexpressionPath(java.lang.Object expression, java.lang.Object[] predicates, java.lang.Object[] steps)Produces an EXPRESSION object representing a filter expressionjava.lang.Objectfunction(int code, java.lang.Object[] args)Produces an EXPRESSION object representing the computation of a core function with the supplied arguments.java.lang.Objectfunction(java.lang.Object name, java.lang.Object[] args)Produces an EXPRESSION object representing the computation of a library function with the supplied arguments.java.lang.ObjectgreaterThan(java.lang.Object left, java.lang.Object right)Produces an EXPRESSION object representing the comparison: left greater than rightjava.lang.ObjectgreaterThanOrEqual(java.lang.Object left, java.lang.Object right)Produces an EXPRESSION object representing the comparison: left greater than or equal to rightprivate booleanisNameAttributeTest(Expression arg)Learn whether arg is a name attribute test.java.lang.ObjectlessThan(java.lang.Object left, java.lang.Object right)Produces an EXPRESSION object representing the comparison: left less than rightjava.lang.ObjectlessThanOrEqual(java.lang.Object left, java.lang.Object right)Produces an EXPRESSION object representing the comparison: left less than or equal to rightjava.lang.Objectliteral(java.lang.String value)Produces an EXPRESSION object that represents a string constant.java.lang.ObjectlocationPath(boolean absolute, java.lang.Object[] steps)Produces an EXPRESSION object representing a location pathjava.lang.Objectminus(java.lang.Object argument)Produces an EXPRESSION object representing unary negation of the argumentjava.lang.Objectminus(java.lang.Object left, java.lang.Object right)Produces an EXPRESSION object representing left minus rightjava.lang.Objectmod(java.lang.Object left, java.lang.Object right)Produces an EXPRESSION object representing left modulo rightjava.lang.Objectmultiply(java.lang.Object left, java.lang.Object right)Produces an EXPRESSION object representing left multiplied by rightjava.lang.ObjectnodeNameTest(java.lang.Object qname)Produces a NODE_TEST object that represents a node name test.java.lang.ObjectnodeTypeTest(int nodeType)Produces a NODE_TEST object that represents a node type test.java.lang.ObjectnotEqual(java.lang.Object left, java.lang.Object right)Produces an EXPRESSION object representing the comparison: left is not equal to rightjava.lang.Objectnumber(java.lang.String value)Produces an EXPRESSION object that represents a numeric constant.java.lang.Objector(java.lang.Object[] arguments)Produces an EXPRESSION object representing logical disjunction of all argumentsjava.lang.ObjectprocessingInstructionTest(java.lang.String instruction)Produces a NODE_TEST object that represents a processing instruction test.java.lang.Objectqname(java.lang.String prefix, java.lang.String name)Produces an QNAME that represents a name with an optional prefix.java.lang.Objectstep(int axis, java.lang.Object nodeTest, java.lang.Object[] predicates)Produces a STEP object that represents a node test.java.lang.Objectsum(java.lang.Object[] arguments)Produces an EXPRESSION object representing the sum of all argumensprivate Expression[]toExpressionArray(java.lang.Object[] array)Get an Object[] as an Expression[].private Step[]toStepArray(java.lang.Object[] array)Get an Object[] as a Step[].java.lang.Objectunion(java.lang.Object[] arguments)Produces an EXPRESSION object representing union of all node setsjava.lang.ObjectvariableReference(java.lang.Object qName)Produces an EXPRESSION object representing variable reference
-
-
-
Field Detail
-
QNAME_NAME
private static final QName QNAME_NAME
-
-
Method Detail
-
number
public java.lang.Object number(java.lang.String value)
Description copied from interface:CompilerProduces an EXPRESSION object that represents a numeric constant.
-
literal
public java.lang.Object literal(java.lang.String value)
Description copied from interface:CompilerProduces an EXPRESSION object that represents a string constant.
-
qname
public java.lang.Object qname(java.lang.String prefix, java.lang.String name)Description copied from interface:CompilerProduces an QNAME that represents a name with an optional prefix.
-
sum
public java.lang.Object sum(java.lang.Object[] arguments)
Description copied from interface:CompilerProduces an EXPRESSION object representing the sum of all argumens
-
minus
public java.lang.Object minus(java.lang.Object left, java.lang.Object right)Description copied from interface:CompilerProduces an EXPRESSION object representing left minus right
-
multiply
public java.lang.Object multiply(java.lang.Object left, java.lang.Object right)Description copied from interface:CompilerProduces an EXPRESSION object representing left multiplied by right
-
divide
public java.lang.Object divide(java.lang.Object left, java.lang.Object right)Description copied from interface:CompilerProduces an EXPRESSION object representing left divided by right
-
mod
public java.lang.Object mod(java.lang.Object left, java.lang.Object right)Description copied from interface:CompilerProduces an EXPRESSION object representing left modulo right
-
lessThan
public java.lang.Object lessThan(java.lang.Object left, java.lang.Object right)Description copied from interface:CompilerProduces an EXPRESSION object representing the comparison: left less than right
-
lessThanOrEqual
public java.lang.Object lessThanOrEqual(java.lang.Object left, java.lang.Object right)Description copied from interface:CompilerProduces an EXPRESSION object representing the comparison: left less than or equal to right- Specified by:
lessThanOrEqualin interfaceCompiler- Parameters:
left- is an EXPRESSION objectright- is an EXPRESSION object- Returns:
- Object
-
greaterThan
public java.lang.Object greaterThan(java.lang.Object left, java.lang.Object right)Description copied from interface:CompilerProduces an EXPRESSION object representing the comparison: left greater than right- Specified by:
greaterThanin interfaceCompiler- Parameters:
left- is an EXPRESSION objectright- is an EXPRESSION object- Returns:
- Object
-
greaterThanOrEqual
public java.lang.Object greaterThanOrEqual(java.lang.Object left, java.lang.Object right)Description copied from interface:CompilerProduces an EXPRESSION object representing the comparison: left greater than or equal to right- Specified by:
greaterThanOrEqualin interfaceCompiler- Parameters:
left- is an EXPRESSION objectright- is an EXPRESSION object- Returns:
- Object
-
equal
public java.lang.Object equal(java.lang.Object left, java.lang.Object right)Description copied from interface:CompilerProduces an EXPRESSION object representing the comparison: left equals to right
-
notEqual
public java.lang.Object notEqual(java.lang.Object left, java.lang.Object right)Description copied from interface:CompilerProduces an EXPRESSION object representing the comparison: left is not equal to right
-
minus
public java.lang.Object minus(java.lang.Object argument)
Description copied from interface:CompilerProduces an EXPRESSION object representing unary negation of the argument
-
variableReference
public java.lang.Object variableReference(java.lang.Object qName)
Description copied from interface:CompilerProduces an EXPRESSION object representing variable reference- Specified by:
variableReferencein interfaceCompiler- Parameters:
qName- is a QNAME object- Returns:
- Object
-
function
public java.lang.Object function(int code, java.lang.Object[] args)Description copied from interface:CompilerProduces an EXPRESSION object representing the computation of a core function with the supplied arguments.
-
function
public java.lang.Object function(java.lang.Object name, java.lang.Object[] args)Description copied from interface:CompilerProduces an EXPRESSION object representing the computation of a library function with the supplied arguments.
-
and
public java.lang.Object and(java.lang.Object[] arguments)
Description copied from interface:CompilerProduces an EXPRESSION object representing logical conjunction of all arguments
-
or
public java.lang.Object or(java.lang.Object[] arguments)
Description copied from interface:CompilerProduces an EXPRESSION object representing logical disjunction of all arguments
-
union
public java.lang.Object union(java.lang.Object[] arguments)
Description copied from interface:CompilerProduces an EXPRESSION object representing union of all node sets
-
locationPath
public java.lang.Object locationPath(boolean absolute, java.lang.Object[] steps)Description copied from interface:CompilerProduces an EXPRESSION object representing a location path- Specified by:
locationPathin interfaceCompiler- Parameters:
absolute- indicates whether the path is absolutesteps- are STEP objects- Returns:
- Object
-
expressionPath
public java.lang.Object expressionPath(java.lang.Object expression, java.lang.Object[] predicates, java.lang.Object[] steps)Description copied from interface:CompilerProduces an EXPRESSION object representing a filter expression- Specified by:
expressionPathin interfaceCompiler- Parameters:
expression- is an EXPRESSION objectpredicates- are EXPRESSION objectssteps- are STEP objects- Returns:
- Object
-
nodeNameTest
public java.lang.Object nodeNameTest(java.lang.Object qname)
Description copied from interface:CompilerProduces a NODE_TEST object that represents a node name test.- Specified by:
nodeNameTestin interfaceCompiler- Parameters:
qname- is a QNAME object- Returns:
- Object
-
nodeTypeTest
public java.lang.Object nodeTypeTest(int nodeType)
Description copied from interface:CompilerProduces a NODE_TEST object that represents a node type test.- Specified by:
nodeTypeTestin interfaceCompiler- Parameters:
nodeType- is a NODE_TEST object- Returns:
- Object
-
processingInstructionTest
public java.lang.Object processingInstructionTest(java.lang.String instruction)
Description copied from interface:CompilerProduces a NODE_TEST object that represents a processing instruction test.- Specified by:
processingInstructionTestin interfaceCompiler- Parameters:
instruction- is a NODE_TEST object- Returns:
- Object
-
step
public java.lang.Object step(int axis, java.lang.Object nodeTest, java.lang.Object[] predicates)Description copied from interface:CompilerProduces a STEP object that represents a node test.
-
toExpressionArray
private Expression[] toExpressionArray(java.lang.Object[] array)
Get an Object[] as an Expression[].- Parameters:
array- Object[]- Returns:
- Expression[]
-
toStepArray
private Step[] toStepArray(java.lang.Object[] array)
Get an Object[] as a Step[].- Parameters:
array- Object[]- Returns:
- Step[]
-
isNameAttributeTest
private boolean isNameAttributeTest(Expression arg)
Learn whether arg is a name attribute test.- Parameters:
arg- Expression to test- Returns:
- boolean
-
-