Package org.jaxen.expr
Class DefaultXPathFactory
java.lang.Object
org.jaxen.expr.DefaultXPathFactory
- All Implemented Interfaces:
XPathFactory
The concrete implementation of the XPathFactory anstract factory.
- See Also:
-
Constructor Summary
Constructors -
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 piName) 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 variable) Create a new variable reference expression.createXPath
(Expr rootExpr) Create a newXPathExpr
from anExpr
.protected IterableAxis
getIterableAxis
(int axis)
-
Constructor Details
-
DefaultXPathFactory
public DefaultXPathFactory()
-
-
Method Details
-
createXPath
Description copied from interface:XPathFactory
Create a newXPathExpr
from anExpr
.- Specified by:
createXPath
in interfaceXPathFactory
- Parameters:
rootExpr
- the expression wrapped by the resulting XPathExpr- Returns:
- an XPathExpr wrapping the root expression
- Throws:
JaxenException
-
createPathExpr
public PathExpr createPathExpr(FilterExpr filterExpr, LocationPath locationPath) throws JaxenException Description copied from interface:XPathFactory
Create a new path expression.- Specified by:
createPathExpr
in interfaceXPathFactory
- 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
Description copied from interface:XPathFactory
Create a new empty relative location path.- Specified by:
createRelativeLocationPath
in interfaceXPathFactory
- Returns:
- an empty relative location path
- Throws:
JaxenException
-
createAbsoluteLocationPath
Description copied from interface:XPathFactory
Create a new empty absolute location path.- Specified by:
createAbsoluteLocationPath
in interfaceXPathFactory
- Returns:
- an empty absolute location path
- Throws:
JaxenException
-
createOrExpr
Description copied from interface:XPathFactory
Returns a new XPath Or expression.- Specified by:
createOrExpr
in interfaceXPathFactory
- Parameters:
lhs
- the left hand side of the expressionrhs
- the right hand side of the expression- Returns:
lhs or rhs
- Throws:
JaxenException
-
createAndExpr
Description copied from interface:XPathFactory
Returns a new XPath And expression.- Specified by:
createAndExpr
in interfaceXPathFactory
- Parameters:
lhs
- the left hand side of the expressionrhs
- the right hand side of the expression- Returns:
lhs and rhs
- Throws:
JaxenException
-
createEqualityExpr
public BinaryExpr createEqualityExpr(Expr lhs, Expr rhs, int equalityOperator) throws JaxenException Description copied from interface:XPathFactory
Returns a new XPath equality expression.- Specified by:
createEqualityExpr
in interfaceXPathFactory
- Parameters:
lhs
- the left hand side of the expressionrhs
- the right hand side of the expressionequalityOperator
-Operator.EQUALS
orOperator.NOT_EQUALS
- Returns:
lhs = rhs
orlhs != rhs
- Throws:
JaxenException
- if the third argument is notOperator.EQUALS
orOperator.NOT_EQUALS
-
createRelationalExpr
public BinaryExpr createRelationalExpr(Expr lhs, Expr rhs, int relationalOperator) throws JaxenException Description copied from interface:XPathFactory
Returns a new XPath relational expression.- Specified by:
createRelationalExpr
in interfaceXPathFactory
- 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 rhs
orlhs != rhs
- Throws:
JaxenException
- if the third argument is not a relational operator constant
-
createAdditiveExpr
public BinaryExpr createAdditiveExpr(Expr lhs, Expr rhs, int additiveOperator) throws JaxenException Description copied from interface:XPathFactory
Returns a new XPath additive expression.- Specified by:
createAdditiveExpr
in interfaceXPathFactory
- Parameters:
lhs
- the left hand side of the expressionrhs
- the right hand side of the expressionadditiveOperator
-Operator.ADD
orOperator.SUBTRACT
- Returns:
lhs + rhs
orlhs - rhs
- Throws:
JaxenException
- if the third argument is notOperator.ADD
orOperator.SUBTRACT
-
createMultiplicativeExpr
public BinaryExpr createMultiplicativeExpr(Expr lhs, Expr rhs, int multiplicativeOperator) throws JaxenException Description copied from interface:XPathFactory
Returns a new XPath multiplicative expression.- Specified by:
createMultiplicativeExpr
in interfaceXPathFactory
- 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
Description copied from interface:XPathFactory
Returns a new XPath unary expression.- Specified by:
createUnaryExpr
in interfaceXPathFactory
- Parameters:
expr
- the expression to be negatedunaryOperator
-Operator.NEGATIVE
- Returns:
- expr
orexpr
- Throws:
JaxenException
-
createUnionExpr
Description copied from interface:XPathFactory
Returns a new XPath union expression.- Specified by:
createUnionExpr
in interfaceXPathFactory
- Parameters:
lhs
- the left hand side of the expressionrhs
- the right hand side of the expression- Returns:
lhs | rhs
- Throws:
JaxenException
-
createFilterExpr
Description copied from interface:XPathFactory
Returns a new XPath filter expression.- Specified by:
createFilterExpr
in interfaceXPathFactory
- Parameters:
expr
- the basic expression to which the predicate will be added- Returns:
- the expression with an empty predicate set
- Throws:
JaxenException
-
createFunctionCallExpr
public FunctionCallExpr createFunctionCallExpr(String prefix, String functionName) throws JaxenException Description copied from interface:XPathFactory
Create a new function call expression.- Specified by:
createFunctionCallExpr
in interfaceXPathFactory
- 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
Description copied from interface:XPathFactory
Create a number expression.- Specified by:
createNumberExpr
in interfaceXPathFactory
- Parameters:
number
- the value- Returns:
- a number expression wrapping that value
- Throws:
JaxenException
-
createNumberExpr
Description copied from interface:XPathFactory
Create a number expression.- Specified by:
createNumberExpr
in interfaceXPathFactory
- Parameters:
number
- the value- Returns:
- a number expression wrapping that value
- Throws:
JaxenException
-
createLiteralExpr
Description copied from interface:XPathFactory
Create a string literal expression.- Specified by:
createLiteralExpr
in interfaceXPathFactory
- Parameters:
literal
- the value- Returns:
- a literal expression wrapping that value
- Throws:
JaxenException
-
createVariableReferenceExpr
public VariableReferenceExpr createVariableReferenceExpr(String prefix, String variable) throws JaxenException Description copied from interface:XPathFactory
Create a new variable reference expression.- Specified by:
createVariableReferenceExpr
in interfaceXPathFactory
- Parameters:
prefix
- the namespace prefix of the variablevariable
- the local name of the variable- Returns:
- a variable expression
- Throws:
JaxenException
-
createNameStep
Description copied from interface:XPathFactory
Create a step with a named node-test.- Specified by:
createNameStep
in interfaceXPathFactory
- 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
- ifaxis
is not one of the axis constants????
-
createTextNodeStep
Description copied from interface:XPathFactory
Create a step with atext()
node-test.- Specified by:
createTextNodeStep
in interfaceXPathFactory
- Parameters:
axis
- the axis to create thetext()
node-test on- Returns:
- a text node step
- Throws:
JaxenException
- ifaxis
is not one of the axis constants????
-
createCommentNodeStep
Description copied from interface:XPathFactory
Create a step with acomment()
node-test.- Specified by:
createCommentNodeStep
in interfaceXPathFactory
- Parameters:
axis
- the axis to create thecomment()
node-test on- Returns:
- a comment node step
- Throws:
JaxenException
- ifaxis
is not one of the axis constants????
-
createAllNodeStep
Description copied from interface:XPathFactory
Create a step with a node() node-test.- Specified by:
createAllNodeStep
in interfaceXPathFactory
- Parameters:
axis
- the axis to create the node-test on- Returns:
- an all node step
- Throws:
JaxenException
- ifaxis
is not one of the axis constants????
-
createProcessingInstructionNodeStep
Description copied from interface:XPathFactory
Create a step with aprocessing-instruction()
node-test.- Specified by:
createProcessingInstructionNodeStep
in interfaceXPathFactory
- Parameters:
axis
- the axis to create theprocessing-instruction()
node-test onpiName
- the target to match, may be empty- Returns:
- a processing instruction node step
- Throws:
JaxenException
- ifaxis
is not one of the axis constants????
-
createPredicate
Description copied from interface:XPathFactory
Create from the supplied expression.- Specified by:
createPredicate
in interfaceXPathFactory
- Parameters:
predicateExpr
- the expression to evaluate in the predicate- Returns:
- a predicate
- Throws:
JaxenException
-
getIterableAxis
- Throws:
JaxenException
-
createPredicateSet
Description copied from interface:XPathFactory
Create an empty predicate set.- Specified by:
createPredicateSet
in interfaceXPathFactory
- Returns:
- an empty predicate set
- Throws:
JaxenException
-