Class TreeCompiler
- java.lang.Object
-
- org.apache.commons.jxpath.ri.compiler.TreeCompiler
-
-
Field Summary
Fields Modifier and Type Field Description private static QName
QNAME_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.Object
and(java.lang.Object[] arguments)
Produces an EXPRESSION object representing logical conjunction of all argumentsjava.lang.Object
divide(java.lang.Object left, java.lang.Object right)
Produces an EXPRESSION object representing left divided by rightjava.lang.Object
equal(java.lang.Object left, java.lang.Object right)
Produces an EXPRESSION object representing the comparison: left equals to rightjava.lang.Object
expressionPath(java.lang.Object expression, java.lang.Object[] predicates, java.lang.Object[] steps)
Produces an EXPRESSION object representing a filter expressionjava.lang.Object
function(int code, java.lang.Object[] args)
Produces an EXPRESSION object representing the computation of a core function with the supplied arguments.java.lang.Object
function(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.Object
greaterThan(java.lang.Object left, java.lang.Object right)
Produces an EXPRESSION object representing the comparison: left greater than rightjava.lang.Object
greaterThanOrEqual(java.lang.Object left, java.lang.Object right)
Produces an EXPRESSION object representing the comparison: left greater than or equal to rightprivate boolean
isNameAttributeTest(Expression arg)
Learn whether arg is a name attribute test.java.lang.Object
lessThan(java.lang.Object left, java.lang.Object right)
Produces an EXPRESSION object representing the comparison: left less than rightjava.lang.Object
lessThanOrEqual(java.lang.Object left, java.lang.Object right)
Produces an EXPRESSION object representing the comparison: left less than or equal to rightjava.lang.Object
literal(java.lang.String value)
Produces an EXPRESSION object that represents a string constant.java.lang.Object
locationPath(boolean absolute, java.lang.Object[] steps)
Produces an EXPRESSION object representing a location pathjava.lang.Object
minus(java.lang.Object argument)
Produces an EXPRESSION object representing unary negation of the argumentjava.lang.Object
minus(java.lang.Object left, java.lang.Object right)
Produces an EXPRESSION object representing left minus rightjava.lang.Object
mod(java.lang.Object left, java.lang.Object right)
Produces an EXPRESSION object representing left modulo rightjava.lang.Object
multiply(java.lang.Object left, java.lang.Object right)
Produces an EXPRESSION object representing left multiplied by rightjava.lang.Object
nodeNameTest(java.lang.Object qname)
Produces a NODE_TEST object that represents a node name test.java.lang.Object
nodeTypeTest(int nodeType)
Produces a NODE_TEST object that represents a node type test.java.lang.Object
notEqual(java.lang.Object left, java.lang.Object right)
Produces an EXPRESSION object representing the comparison: left is not equal to rightjava.lang.Object
number(java.lang.String value)
Produces an EXPRESSION object that represents a numeric constant.java.lang.Object
or(java.lang.Object[] arguments)
Produces an EXPRESSION object representing logical disjunction of all argumentsjava.lang.Object
processingInstructionTest(java.lang.String instruction)
Produces a NODE_TEST object that represents a processing instruction test.java.lang.Object
qname(java.lang.String prefix, java.lang.String name)
Produces an QNAME that represents a name with an optional prefix.java.lang.Object
step(int axis, java.lang.Object nodeTest, java.lang.Object[] predicates)
Produces a STEP object that represents a node test.java.lang.Object
sum(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.Object
union(java.lang.Object[] arguments)
Produces an EXPRESSION object representing union of all node setsjava.lang.Object
variableReference(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:Compiler
Produces an EXPRESSION object that represents a numeric constant.
-
literal
public java.lang.Object literal(java.lang.String value)
Description copied from interface:Compiler
Produces 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:Compiler
Produces an QNAME that represents a name with an optional prefix.
-
sum
public java.lang.Object sum(java.lang.Object[] arguments)
Description copied from interface:Compiler
Produces 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:Compiler
Produces 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:Compiler
Produces 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:Compiler
Produces 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:Compiler
Produces 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:Compiler
Produces 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:Compiler
Produces an EXPRESSION object representing the comparison: left less than or equal to right- Specified by:
lessThanOrEqual
in 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:Compiler
Produces an EXPRESSION object representing the comparison: left greater than right- Specified by:
greaterThan
in 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:Compiler
Produces an EXPRESSION object representing the comparison: left greater than or equal to right- Specified by:
greaterThanOrEqual
in 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:Compiler
Produces 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:Compiler
Produces 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:Compiler
Produces an EXPRESSION object representing unary negation of the argument
-
variableReference
public java.lang.Object variableReference(java.lang.Object qName)
Description copied from interface:Compiler
Produces an EXPRESSION object representing variable reference- Specified by:
variableReference
in 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:Compiler
Produces 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:Compiler
Produces 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:Compiler
Produces an EXPRESSION object representing logical conjunction of all arguments
-
or
public java.lang.Object or(java.lang.Object[] arguments)
Description copied from interface:Compiler
Produces an EXPRESSION object representing logical disjunction of all arguments
-
union
public java.lang.Object union(java.lang.Object[] arguments)
Description copied from interface:Compiler
Produces 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:Compiler
Produces an EXPRESSION object representing a location path- Specified by:
locationPath
in 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:Compiler
Produces an EXPRESSION object representing a filter expression- Specified by:
expressionPath
in 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:Compiler
Produces a NODE_TEST object that represents a node name test.- Specified by:
nodeNameTest
in interfaceCompiler
- Parameters:
qname
- is a QNAME object- Returns:
- Object
-
nodeTypeTest
public java.lang.Object nodeTypeTest(int nodeType)
Description copied from interface:Compiler
Produces a NODE_TEST object that represents a node type test.- Specified by:
nodeTypeTest
in interfaceCompiler
- Parameters:
nodeType
- is a NODE_TEST object- Returns:
- Object
-
processingInstructionTest
public java.lang.Object processingInstructionTest(java.lang.String instruction)
Description copied from interface:Compiler
Produces a NODE_TEST object that represents a processing instruction test.- Specified by:
processingInstructionTest
in 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:Compiler
Produces 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
-
-