org.apache.commons.jxpath.ri.compiler

Class TreeCompiler

Implemented Interfaces:
Compiler

public class TreeCompiler
extends java.lang.Object
implements Compiler

Version:
$Revision: 1.10 $ $Date: 2004/02/29 14:17:39 $
Author:
Dmitri Plotnikov

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

Method Summary

Object
and(arguments[] )
Produces an EXPRESSION object representing logical conjunction of all arguments
Object
divide(Object left, Object right)
Produces an EXPRESSION object representing left divided by right
Object
equal(Object left, Object right)
Produces an EXPRESSION object representing the comparison: left equals to right
Object
expressionPath(Object expression, Object[] predicates, Object[] steps)
Produces an EXPRESSION object representing a filter expression
Object
function(Object name, Object[] args)
Produces an EXPRESSION object representing the computation of a library function with the supplied arguments.
Object
function(int code, Object[] args)
Produces an EXPRESSION object representing the computation of a core function with the supplied arguments.
Object
greaterThan(Object left, Object right)
Produces an EXPRESSION object representing the comparison: left greater than right
Object
greaterThanOrEqual(Object left, Object right)
Produces an EXPRESSION object representing the comparison: left greater than or equal to right
Object
lessThan(Object left, Object right)
Produces an EXPRESSION object representing the comparison: left less than right
Object
lessThanOrEqual(Object left, Object right)
Produces an EXPRESSION object representing the comparison: left less than or equal to right
Object
literal(String value)
Produces an EXPRESSION object that represents a string constant.
Object
locationPath(boolean absolute, Object[] steps)
Produces an EXPRESSION object representing a location path
Object
minus(Object argument)
Produces an EXPRESSION object representing unary negation of the argument
Object
minus(Object left, Object right)
Produces an EXPRESSION object representing left minus right
Object
mod(Object left, Object right)
Produces an EXPRESSION object representing left modulo right
Object
multiply(Object left, Object right)
Produces an EXPRESSION object representing left multiplied by right
Object
nodeNameTest(Object qname)
Produces a NODE_TEST object that represents a node name test.
Object
nodeTypeTest(int nodeType)
Produces a NODE_TEST object that represents a node type test.
Object
notEqual(Object left, Object right)
Produces an EXPRESSION object representing the comparison: left is not equal to right
Object
number(String value)
Produces an EXPRESSION object that represents a numeric constant.
Object
or(arguments[] )
Produces an EXPRESSION object representing logical disjunction of all arguments
Object
processingInstructionTest(String instruction)
Produces a NODE_TEST object that represents a processing instruction test.
Object
qname(String prefix, String name)
Produces an QNAME that represents a name with an optional prefix.
Object
step(int axis, Object nodeTest, Object[] predicates)
Produces a STEP object that represents a node test.
Object
sum(Object[] arguments)
Produces an EXPRESSION object representing the sum of all argumens
Object
union(Object[] arguments)
Produces an EXPRESSION object representing union of all node sets
Object
variableReference(Object qName)
Produces an EXPRESSION object representing variable reference

Method Details

and

public Object and(arguments[] )
Produces an EXPRESSION object representing logical conjunction of all arguments
Specified by:
and in interface Compiler
Parameters:

divide

public Object divide(Object left,
                     Object right)
Produces an EXPRESSION object representing left divided by right
Specified by:
divide in interface Compiler
Parameters:
left - is an EXPRESSION object
right - is an EXPRESSION object

equal

public Object equal(Object left,
                    Object right)
Produces an EXPRESSION object representing the comparison: left equals to right
Specified by:
equal in interface Compiler
Parameters:
left - is an EXPRESSION object
right - is an EXPRESSION object

expressionPath

public Object expressionPath(Object expression,
                             Object[] predicates,
                             Object[] steps)
Produces an EXPRESSION object representing a filter expression
Specified by:
expressionPath in interface Compiler
Parameters:
expression - is an EXPRESSION object
predicates - are EXPRESSION objects
steps - are STEP objects

function

public Object function(Object name,
                       Object[] args)
Produces an EXPRESSION object representing the computation of a library function with the supplied arguments.
Specified by:
function in interface Compiler
Parameters:
name - is a QNAME object (function name)
args - are EXPRESSION objects

function

public Object function(int code,
                       Object[] args)
Produces an EXPRESSION object representing the computation of a core function with the supplied arguments.
Specified by:
function in interface Compiler
Parameters:
code - is one of FUNCTION_... constants
args - are EXPRESSION objects

greaterThan

public Object greaterThan(Object left,
                          Object right)
Produces an EXPRESSION object representing the comparison: left greater than right
Specified by:
greaterThan in interface Compiler
Parameters:
left - is an EXPRESSION object
right - is an EXPRESSION object

greaterThanOrEqual

public Object greaterThanOrEqual(Object left,
                                 Object right)
Produces an EXPRESSION object representing the comparison: left greater than or equal to right
Specified by:
greaterThanOrEqual in interface Compiler
Parameters:
left - is an EXPRESSION object
right - is an EXPRESSION object

lessThan

public Object lessThan(Object left,
                       Object right)
Produces an EXPRESSION object representing the comparison: left less than right
Specified by:
lessThan in interface Compiler
Parameters:
left - is an EXPRESSION object
right - is an EXPRESSION object

lessThanOrEqual

public Object lessThanOrEqual(Object left,
                              Object right)
Produces an EXPRESSION object representing the comparison: left less than or equal to right
Specified by:
lessThanOrEqual in interface Compiler
Parameters:
left - is an EXPRESSION object
right - is an EXPRESSION object

literal

public Object literal(String value)
Produces an EXPRESSION object that represents a string constant.
Specified by:
literal in interface Compiler

locationPath

public Object locationPath(boolean absolute,
                           Object[] steps)
Produces an EXPRESSION object representing a location path
Specified by:
locationPath in interface Compiler
Parameters:
absolute - indicates whether the path is absolute
steps - are STEP objects

minus

public Object minus(Object argument)
Produces an EXPRESSION object representing unary negation of the argument
Specified by:
minus in interface Compiler
Parameters:
argument - is an EXPRESSION object

minus

public Object minus(Object left,
                    Object right)
Produces an EXPRESSION object representing left minus right
Specified by:
minus in interface Compiler
Parameters:
left - is an EXPRESSION object
right - is an EXPRESSION object

mod

public Object mod(Object left,
                  Object right)
Produces an EXPRESSION object representing left modulo right
Specified by:
mod in interface Compiler
Parameters:
left - is an EXPRESSION object
right - is an EXPRESSION object

multiply

public Object multiply(Object left,
                       Object right)
Produces an EXPRESSION object representing left multiplied by right
Specified by:
multiply in interface Compiler
Parameters:
left - is an EXPRESSION object
right - is an EXPRESSION object

nodeNameTest

public Object nodeNameTest(Object qname)
Produces a NODE_TEST object that represents a node name test.
Specified by:
nodeNameTest in interface Compiler
Parameters:
qname - is a QNAME object

nodeTypeTest

public Object nodeTypeTest(int nodeType)
Produces a NODE_TEST object that represents a node type test.
Specified by:
nodeTypeTest in interface Compiler
Parameters:

notEqual

public Object notEqual(Object left,
                       Object right)
Produces an EXPRESSION object representing the comparison: left is not equal to right
Specified by:
notEqual in interface Compiler
Parameters:
left - is an EXPRESSION object
right - is an EXPRESSION object

number

public Object number(String value)
Produces an EXPRESSION object that represents a numeric constant.
Specified by:
number in interface Compiler

or

public Object or(arguments[] )
Produces an EXPRESSION object representing logical disjunction of all arguments
Specified by:
or in interface Compiler
Parameters:

processingInstructionTest

public Object processingInstructionTest(String instruction)
Produces a NODE_TEST object that represents a processing instruction test.
Specified by:
processingInstructionTest in interface Compiler
Parameters:

qname

public Object qname(String prefix,
                    String name)
Produces an QNAME that represents a name with an optional prefix.
Specified by:
qname in interface Compiler

step

public Object step(int axis,
                   Object nodeTest,
                   Object[] predicates)
Produces a STEP object that represents a node test.
Specified by:
step in interface Compiler
Parameters:
axis - is one of the AXIS_... constants
nodeTest - is a NODE_TEST object
predicates - are EXPRESSION objects

sum

public Object sum(Object[] arguments)
Produces an EXPRESSION object representing the sum of all argumens
Specified by:
sum in interface Compiler
Parameters:
arguments - are EXPRESSION objects

union

public Object union(Object[] arguments)
Produces an EXPRESSION object representing union of all node sets
Specified by:
union in interface Compiler
Parameters:
arguments - are EXPRESSION objects

variableReference

public Object variableReference(Object qName)
Produces an EXPRESSION object representing variable reference
Specified by:
variableReference in interface Compiler
Parameters: