Interface XPathFactory
- All Known Implementing Classes:
DefaultXPathFactory
public interface XPathFactory
An abstract factory used to create individual path component objects.
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new empty absolute location path.createAdditiveExpr(Expr lhs, Expr rhs, int additiveOperator) Returns a new XPath additive expression.createAllNodeStep(int axis) Create a step with a node() node-test.createAndExpr(Expr lhs, Expr rhs) Returns a new XPath And expression.createCommentNodeStep(int axis) Create a step with acomment()node-test.createEqualityExpr(Expr lhs, Expr rhs, int equalityOperator) Returns a new XPath equality expression.createFilterExpr(Expr expr) Returns a new XPath filter expression.createFunctionCallExpr(String prefix, String functionName) Create a new function call expression.createLiteralExpr(String literal) Create a string literal expression.createMultiplicativeExpr(Expr lhs, Expr rhs, int multiplicativeOperator) Returns a new XPath multiplicative expression.createNameStep(int axis, String prefix, String localName) Create a step with a named node-test.createNumberExpr(double number) Create a number expression.createNumberExpr(int number) Create a number expression.createOrExpr(Expr lhs, Expr rhs) Returns a new XPath Or expression.createPathExpr(FilterExpr filterExpr, LocationPath locationPath) Create a new path expression.createPredicate(Expr predicateExpr) Create from the supplied expression.Create an empty predicate set.createProcessingInstructionNodeStep(int axis, String name) Create a step with aprocessing-instruction()node-test.createRelationalExpr(Expr lhs, Expr rhs, int relationalOperator) Returns a new XPath relational expression.Create a new empty relative location path.createTextNodeStep(int axis) Create a step with atext()node-test.createUnaryExpr(Expr expr, int unaryOperator) Returns a new XPath unary expression.createUnionExpr(Expr lhs, Expr rhs) Returns a new XPath union expression.createVariableReferenceExpr(String prefix, String variableName) Create a new variable reference expression.createXPath(Expr rootExpr) Create a newXPathExprfrom anExpr.
-
Method Details
-
createXPath
Create a newXPathExprfrom anExpr.- Parameters:
rootExpr- the expression wrapped by the resulting XPathExpr- Returns:
- an XPathExpr wrapping the root expression
- Throws:
JaxenException
-
createPathExpr
Create a new path expression.- Parameters:
filterExpr- the filter expression that starts the path expressionlocationPath- the location path that follows the filter expression- Returns:
- a path expression formed by concatenating the two arguments
- Throws:
JaxenException
-
createRelativeLocationPath
Create a new empty relative location path.- Returns:
- an empty relative location path
- Throws:
JaxenException
-
createAbsoluteLocationPath
Create a new empty absolute location path.- Returns:
- an empty absolute location path
- Throws:
JaxenException
-
createOrExpr
Returns a new XPath Or expression.- Parameters:
lhs- the left hand side of the expressionrhs- the right hand side of the expression- Returns:
lhs or rhs- Throws:
JaxenException
-
createAndExpr
Returns a new XPath And expression.- Parameters:
lhs- the left hand side of the expressionrhs- the right hand side of the expression- Returns:
lhs and rhs- Throws:
JaxenException
-
createEqualityExpr
Returns a new XPath equality expression.- Parameters:
lhs- the left hand side of the expressionrhs- the right hand side of the expressionequalityOperator-Operator.EQUALSorOperator.NOT_EQUALS- Returns:
lhs = rhsorlhs != rhs- Throws:
JaxenException- if the third argument is notOperator.EQUALSorOperator.NOT_EQUALS
-
createRelationalExpr
Returns a new XPath relational expression.- Parameters:
lhs- the left hand side of the expressionrhs- the right hand side of the expressionrelationalOperator-Operator.LESS_THAN,Operator.GREATER_THAN,Operator.LESS_THAN_EQUALS, orOperator.GREATER_THAN_EQUALS- Returns:
lhs relationalOperator rhsorlhs != rhs- Throws:
JaxenException- if the third argument is not a relational operator constant
-
createAdditiveExpr
Returns a new XPath additive expression.- Parameters:
lhs- the left hand side of the expressionrhs- the right hand side of the expressionadditiveOperator-Operator.ADDorOperator.SUBTRACT- Returns:
lhs + rhsorlhs - rhs- Throws:
JaxenException- if the third argument is notOperator.ADDorOperator.SUBTRACT
-
createMultiplicativeExpr
BinaryExpr createMultiplicativeExpr(Expr lhs, Expr rhs, int multiplicativeOperator) throws JaxenException Returns a new XPath multiplicative expression.- Parameters:
lhs- the left hand side of the expressionrhs- the right hand side of the expressionmultiplicativeOperator-Operator.MULTIPLY,Operator.DIV, orOperator.MOD- Returns:
lhs * rhs,lhs div rhs, orlhs mod rhs- Throws:
JaxenException- if the third argument is not a multiplicative operator constant
-
createUnaryExpr
Returns a new XPath unary expression.- Parameters:
expr- the expression to be negatedunaryOperator-Operator.NEGATIVE- Returns:
- exprorexpr- Throws:
JaxenException
-
createUnionExpr
Returns a new XPath union expression.- Parameters:
lhs- the left hand side of the expressionrhs- the right hand side of the expression- Returns:
lhs | rhs- Throws:
JaxenException
-
createFilterExpr
Returns a new XPath filter expression.- Parameters:
expr- the basic expression to which the predicate will be added- Returns:
- the expression with an empty predicate set
- Throws:
JaxenException
-
createFunctionCallExpr
Create a new function call expression.- Parameters:
prefix- the namespace prefix of the functionfunctionName- the local name of the function- Returns:
- a function with an empty argument list
- Throws:
JaxenException
-
createNumberExpr
Create a number expression.- Parameters:
number- the value- Returns:
- a number expression wrapping that value
- Throws:
JaxenException
-
createNumberExpr
Create a number expression.- Parameters:
number- the value- Returns:
- a number expression wrapping that value
- Throws:
JaxenException
-
createLiteralExpr
Create a string literal expression.- Parameters:
literal- the value- Returns:
- a literal expression wrapping that value
- Throws:
JaxenException
-
createVariableReferenceExpr
VariableReferenceExpr createVariableReferenceExpr(String prefix, String variableName) throws JaxenException Create a new variable reference expression.- Parameters:
prefix- the namespace prefix of the variablevariableName- the local name of the variable- Returns:
- a variable expression
- Throws:
JaxenException
-
createNameStep
Create a step with a named node-test.- Parameters:
axis- the axis to create the name-test onprefix- the namespace prefix for the testlocalName- the local name for the test- Returns:
- a name step
- Throws:
JaxenException- ifaxisis not one of the axis constants????
-
createAllNodeStep
Create a step with a node() node-test.- Parameters:
axis- the axis to create the node-test on- Returns:
- an all node step
- Throws:
JaxenException- ifaxisis not one of the axis constants????
-
createCommentNodeStep
Create a step with acomment()node-test.- Parameters:
axis- the axis to create thecomment()node-test on- Returns:
- a comment node step
- Throws:
JaxenException- ifaxisis not one of the axis constants????
-
createTextNodeStep
Create a step with atext()node-test.- Parameters:
axis- the axis to create thetext()node-test on- Returns:
- a text node step
- Throws:
JaxenException- ifaxisis not one of the axis constants????
-
createProcessingInstructionNodeStep
Create a step with aprocessing-instruction()node-test.- Parameters:
axis- the axis to create theprocessing-instruction()node-test onname- the target to match, may be empty- Returns:
- a processing instruction node step
- Throws:
JaxenException- ifaxisis not one of the axis constants????
-
createPredicate
Create from the supplied expression.- Parameters:
predicateExpr- the expression to evaluate in the predicate- Returns:
- a predicate
- Throws:
JaxenException
-
createPredicateSet
Create an empty predicate set.- Returns:
- an empty predicate set
- Throws:
JaxenException
-