| org.apache.commons.jxpath.ri.Compiler
Compiler | public interface Compiler (Code) | | The Compiler APIs are completely agnostic to the actual types of objects
produced and consumed by the APIs. Arguments and return values are
declared as java.lang.Object.
Since objects returned by Compiler methods are passed as arguments to other
Compiler methods, the descriptions of these methods use virtual types. There
are four virtual object types: EXPRESSION, QNAME, STEP and NODE_TEST.
The following example illustrates this notion. This sequence compiles
the xpath "foo[round(1 div 2)]/text()":
Object qname1 = compiler.qname(null, "foo")
Object expr1 = compiler.number("1");
Object expr2 = compiler.number("2");
Object expr3 = compiler.div(expr1, expr2);
Object expr4 = compiler.
coreFunction(Compiler.FUNCTION_ROUND, new Object[]{expr3});
Object test1 = compiler.nodeNameTest(qname1);
Object step1 = compiler.
step(Compiler.AXIS_CHILD, test1, new Object[]{expr4});
Object test2 = compiler.nodeTypeTest(Compiler.NODE_TYPE_TEXT);
Object step2 = compiler.nodeTypeTest(Compiler.AXIS_CHILD, test2, null);
Object expr5 = compiler.locationPath(false, new Object[]{step1, step2});
author: Dmitri Plotnikov version: $Revision: 1.9 $ $Date: 2004/02/29 14:17:45 $ |
Method Summary | |
Object | and(Object arguments) | Object | divide(Object left, Object right) | Object | equal(Object left, Object right) | Object | expressionPath(Object expression, Object[] predicates, Object[] steps) | Object | function(int code, Object[] args) Produces an EXPRESSION object representing the computation of
a core function with the supplied arguments.
Parameters: code - is one of FUNCTION_... | Object | function(Object name, Object[] args) Produces an EXPRESSION object representing the computation of
a library function with the supplied arguments. | Object | greaterThan(Object left, Object right) | Object | greaterThanOrEqual(Object left, Object right) | Object | lessThan(Object left, Object right) | Object | lessThanOrEqual(Object left, Object right) | Object | literal(String value) Produces an EXPRESSION object that represents a string constant. | Object | locationPath(boolean absolute, Object[] steps) | Object | minus(Object left, Object right) | Object | minus(Object argument) | Object | mod(Object left, Object right) | Object | multiply(Object left, Object 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) | Object | number(String value) Produces an EXPRESSION object that represents a numeric constant. | Object | or(Object 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.
Parameters: axis - is one of the AXIS_... | Object | sum(Object[] arguments) | Object | union(Object[] arguments) | Object | variableReference(Object qName) |
AXIS_ANCESTOR | final public static int AXIS_ANCESTOR(Code) | | |
AXIS_ANCESTOR_OR_SELF | final public static int AXIS_ANCESTOR_OR_SELF(Code) | | |
AXIS_ATTRIBUTE | final public static int AXIS_ATTRIBUTE(Code) | | |
AXIS_CHILD | final public static int AXIS_CHILD(Code) | | |
AXIS_DESCENDANT | final public static int AXIS_DESCENDANT(Code) | | |
AXIS_DESCENDANT_OR_SELF | final public static int AXIS_DESCENDANT_OR_SELF(Code) | | |
AXIS_FOLLOWING | final public static int AXIS_FOLLOWING(Code) | | |
AXIS_FOLLOWING_SIBLING | final public static int AXIS_FOLLOWING_SIBLING(Code) | | |
AXIS_NAMESPACE | final public static int AXIS_NAMESPACE(Code) | | |
AXIS_PARENT | final public static int AXIS_PARENT(Code) | | |
AXIS_PRECEDING | final public static int AXIS_PRECEDING(Code) | | |
AXIS_PRECEDING_SIBLING | final public static int AXIS_PRECEDING_SIBLING(Code) | | |
AXIS_SELF | final public static int AXIS_SELF(Code) | | |
FUNCTION_BOOLEAN | final public static int FUNCTION_BOOLEAN(Code) | | |
FUNCTION_CEILING | final public static int FUNCTION_CEILING(Code) | | |
FUNCTION_CONCAT | final public static int FUNCTION_CONCAT(Code) | | |
FUNCTION_CONTAINS | final public static int FUNCTION_CONTAINS(Code) | | |
FUNCTION_COUNT | final public static int FUNCTION_COUNT(Code) | | |
FUNCTION_FALSE | final public static int FUNCTION_FALSE(Code) | | |
FUNCTION_FLOOR | final public static int FUNCTION_FLOOR(Code) | | |
FUNCTION_FORMAT_NUMBER | final public static int FUNCTION_FORMAT_NUMBER(Code) | | |
FUNCTION_ID | final public static int FUNCTION_ID(Code) | | |
FUNCTION_KEY | final public static int FUNCTION_KEY(Code) | | |
FUNCTION_LANG | final public static int FUNCTION_LANG(Code) | | |
FUNCTION_LAST | final public static int FUNCTION_LAST(Code) | | |
FUNCTION_LOCAL_NAME | final public static int FUNCTION_LOCAL_NAME(Code) | | |
FUNCTION_NAME | final public static int FUNCTION_NAME(Code) | | |
FUNCTION_NAMESPACE_URI | final public static int FUNCTION_NAMESPACE_URI(Code) | | |
FUNCTION_NORMALIZE_SPACE | final public static int FUNCTION_NORMALIZE_SPACE(Code) | | |
FUNCTION_NOT | final public static int FUNCTION_NOT(Code) | | |
FUNCTION_NULL | final public static int FUNCTION_NULL(Code) | | |
FUNCTION_NUMBER | final public static int FUNCTION_NUMBER(Code) | | |
FUNCTION_POSITION | final public static int FUNCTION_POSITION(Code) | | |
FUNCTION_ROUND | final public static int FUNCTION_ROUND(Code) | | |
FUNCTION_STARTS_WITH | final public static int FUNCTION_STARTS_WITH(Code) | | |
FUNCTION_STRING | final public static int FUNCTION_STRING(Code) | | |
FUNCTION_STRING_LENGTH | final public static int FUNCTION_STRING_LENGTH(Code) | | |
FUNCTION_SUBSTRING | final public static int FUNCTION_SUBSTRING(Code) | | |
FUNCTION_SUBSTRING_AFTER | final public static int FUNCTION_SUBSTRING_AFTER(Code) | | |
FUNCTION_SUBSTRING_BEFORE | final public static int FUNCTION_SUBSTRING_BEFORE(Code) | | |
FUNCTION_SUM | final public static int FUNCTION_SUM(Code) | | |
FUNCTION_TRANSLATE | final public static int FUNCTION_TRANSLATE(Code) | | |
FUNCTION_TRUE | final public static int FUNCTION_TRUE(Code) | | |
NODE_TYPE_COMMENT | final public static int NODE_TYPE_COMMENT(Code) | | |
NODE_TYPE_NODE | final public static int NODE_TYPE_NODE(Code) | | |
NODE_TYPE_PI | final public static int NODE_TYPE_PI(Code) | | |
NODE_TYPE_TEXT | final public static int NODE_TYPE_TEXT(Code) | | |
and | Object and(Object arguments)(Code) | | Produces an EXPRESSION object representing logical conjunction of
all arguments
Parameters: arguments - are EXPRESSION objects |
divide | Object divide(Object left, Object right)(Code) | | Produces an EXPRESSION object representing left divided by
right
Parameters: left - is an EXPRESSION object Parameters: right - is an EXPRESSION object |
equal | Object equal(Object left, Object right)(Code) | | Produces an EXPRESSION object representing the comparison:
left equals to right
Parameters: left - is an EXPRESSION object Parameters: right - is an EXPRESSION object |
expressionPath | Object expressionPath(Object expression, Object[] predicates, Object[] steps)(Code) | | Produces an EXPRESSION object representing a filter expression
Parameters: expression - is an EXPRESSION object Parameters: predicates - are EXPRESSION objects Parameters: steps - are STEP objects |
function | Object function(int code, Object[] args)(Code) | | Produces an EXPRESSION object representing the computation of
a core function with the supplied arguments.
Parameters: code - is one of FUNCTION_... constants Parameters: args - are EXPRESSION objects |
function | Object function(Object name, Object[] args)(Code) | | Produces an EXPRESSION object representing the computation of
a library function with the supplied arguments.
Parameters: name - is a QNAME object (function name) Parameters: args - are EXPRESSION objects |
greaterThan | Object greaterThan(Object left, Object right)(Code) | | Produces an EXPRESSION object representing the comparison:
left greater than right
Parameters: left - is an EXPRESSION object Parameters: right - is an EXPRESSION object |
greaterThanOrEqual | Object greaterThanOrEqual(Object left, Object right)(Code) | | Produces an EXPRESSION object representing the comparison:
left greater than or equal to right
Parameters: left - is an EXPRESSION object Parameters: right - is an EXPRESSION object |
lessThan | Object lessThan(Object left, Object right)(Code) | | Produces an EXPRESSION object representing the comparison:
left less than right
Parameters: left - is an EXPRESSION object Parameters: right - is an EXPRESSION object |
lessThanOrEqual | Object lessThanOrEqual(Object left, Object right)(Code) | | Produces an EXPRESSION object representing the comparison:
left less than or equal to right
Parameters: left - is an EXPRESSION object Parameters: right - is an EXPRESSION object |
literal | Object literal(String value)(Code) | | Produces an EXPRESSION object that represents a string constant.
|
locationPath | Object locationPath(boolean absolute, Object[] steps)(Code) | | Produces an EXPRESSION object representing a location path
Parameters: absolute - indicates whether the path is absolute Parameters: steps - are STEP objects |
minus | Object minus(Object left, Object right)(Code) | | Produces an EXPRESSION object representing left minus right
Parameters: left - is an EXPRESSION object Parameters: right - is an EXPRESSION object |
minus | Object minus(Object argument)(Code) | | Produces an EXPRESSION object representing unary negation of the argument
Parameters: argument - is an EXPRESSION object |
mod | Object mod(Object left, Object right)(Code) | | Produces an EXPRESSION object representing left modulo
right
Parameters: left - is an EXPRESSION object Parameters: right - is an EXPRESSION object |
multiply | Object multiply(Object left, Object right)(Code) | | Produces an EXPRESSION object representing left multiplied by
right
Parameters: left - is an EXPRESSION object Parameters: right - is an EXPRESSION object |
nodeNameTest | Object nodeNameTest(Object qname)(Code) | | Produces a NODE_TEST object that represents a node name test.
Parameters: qname - is a QNAME object |
nodeTypeTest | Object nodeTypeTest(int nodeType)(Code) | | Produces a NODE_TEST object that represents a node type test.
Parameters: qname - is a QNAME object |
notEqual | Object notEqual(Object left, Object right)(Code) | | Produces an EXPRESSION object representing the comparison:
left is not equal to right
Parameters: left - is an EXPRESSION object Parameters: right - is an EXPRESSION object |
number | Object number(String value)(Code) | | Produces an EXPRESSION object that represents a numeric constant.
|
or | Object or(Object arguments)(Code) | | Produces an EXPRESSION object representing logical disjunction of
all arguments
Parameters: arguments - are EXPRESSION objects |
processingInstructionTest | Object processingInstructionTest(String instruction)(Code) | | Produces a NODE_TEST object that represents a processing instruction
test.
Parameters: qname - is a QNAME object |
step | Object step(int axis, Object nodeTest, Object[] predicates)(Code) | | Produces a STEP object that represents a node test.
Parameters: axis - is one of the AXIS_... constants Parameters: nodeTest - is a NODE_TEST object Parameters: predicates - are EXPRESSION objects |
sum | Object sum(Object[] arguments)(Code) | | Produces an EXPRESSION object representing the sum of all argumens
Parameters: arguments - are EXPRESSION objects |
union | Object union(Object[] arguments)(Code) | | Produces an EXPRESSION object representing union of all node sets
Parameters: arguments - are EXPRESSION objects |
variableReference | Object variableReference(Object qName)(Code) | | Produces an EXPRESSION object representing variable reference
Parameters: qname - is a QNAME object |
|
|