Package org.jaxen.expr
Class DefaultXPathFactory
- java.lang.Object
-
- org.jaxen.expr.DefaultXPathFactory
-
- All Implemented Interfaces:
XPathFactory
public class DefaultXPathFactory extends java.lang.Object implements XPathFactory
The concrete implementation of the XPathFactory anstract factory.- See Also:
XPathFactory
-
-
Constructor Summary
Constructors Constructor Description DefaultXPathFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LocationPathcreateAbsoluteLocationPath()Create a new empty absolute location path.BinaryExprcreateAdditiveExpr(Expr lhs, Expr rhs, int additiveOperator)Returns a new XPath additive expression.StepcreateAllNodeStep(int axis)Create a step with a node() node-test.BinaryExprcreateAndExpr(Expr lhs, Expr rhs)Returns a new XPath And expression.StepcreateCommentNodeStep(int axis)Create a step with acomment()node-test.BinaryExprcreateEqualityExpr(Expr lhs, Expr rhs, int equalityOperator)Returns a new XPath equality expression.FilterExprcreateFilterExpr(Expr expr)Returns a new XPath filter expression.FunctionCallExprcreateFunctionCallExpr(java.lang.String prefix, java.lang.String functionName)Create a new function call expression.LiteralExprcreateLiteralExpr(java.lang.String literal)Create a string literal expression.BinaryExprcreateMultiplicativeExpr(Expr lhs, Expr rhs, int multiplicativeOperator)Returns a new XPath multiplicative expression.StepcreateNameStep(int axis, java.lang.String prefix, java.lang.String localName)Create a step with a named node-test.NumberExprcreateNumberExpr(double number)Create a number expression.NumberExprcreateNumberExpr(int number)Create a number expression.BinaryExprcreateOrExpr(Expr lhs, Expr rhs)Returns a new XPath Or expression.PathExprcreatePathExpr(FilterExpr filterExpr, LocationPath locationPath)Create a new path expression.PredicatecreatePredicate(Expr predicateExpr)Create from the supplied expression.PredicateSetcreatePredicateSet()Create an empty predicate set.StepcreateProcessingInstructionNodeStep(int axis, java.lang.String piName)Create a step with aprocessing-instruction()node-test.BinaryExprcreateRelationalExpr(Expr lhs, Expr rhs, int relationalOperator)Returns a new XPath relational expression.LocationPathcreateRelativeLocationPath()Create a new empty relative location path.StepcreateTextNodeStep(int axis)Create a step with atext()node-test.ExprcreateUnaryExpr(Expr expr, int unaryOperator)Returns a new XPath unary expression.UnionExprcreateUnionExpr(Expr lhs, Expr rhs)Returns a new XPath union expression.VariableReferenceExprcreateVariableReferenceExpr(java.lang.String prefix, java.lang.String variable)Create a new variable reference expression.XPathExprcreateXPath(Expr rootExpr)Create a newXPathExprfrom anExpr.protected IterableAxisgetIterableAxis(int axis)
-
-
-
Method Detail
-
createXPath
public XPathExpr createXPath(Expr rootExpr) throws JaxenException
Description copied from interface:XPathFactoryCreate a newXPathExprfrom anExpr.- Specified by:
createXPathin 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:XPathFactoryCreate a new path expression.- Specified by:
createPathExprin 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
public LocationPath createRelativeLocationPath() throws JaxenException
Description copied from interface:XPathFactoryCreate a new empty relative location path.- Specified by:
createRelativeLocationPathin interfaceXPathFactory- Returns:
- an empty relative location path
- Throws:
JaxenException
-
createAbsoluteLocationPath
public LocationPath createAbsoluteLocationPath() throws JaxenException
Description copied from interface:XPathFactoryCreate a new empty absolute location path.- Specified by:
createAbsoluteLocationPathin interfaceXPathFactory- Returns:
- an empty absolute location path
- Throws:
JaxenException
-
createOrExpr
public BinaryExpr createOrExpr(Expr lhs, Expr rhs) throws JaxenException
Description copied from interface:XPathFactoryReturns a new XPath Or expression.- Specified by:
createOrExprin interfaceXPathFactory- Parameters:
lhs- the left hand side of the expressionrhs- the right hand side of the expression- Returns:
lhs or rhs- Throws:
JaxenException
-
createAndExpr
public BinaryExpr createAndExpr(Expr lhs, Expr rhs) throws JaxenException
Description copied from interface:XPathFactoryReturns a new XPath And expression.- Specified by:
createAndExprin 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:XPathFactoryReturns a new XPath equality expression.- Specified by:
createEqualityExprin interfaceXPathFactory- 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
public BinaryExpr createRelationalExpr(Expr lhs, Expr rhs, int relationalOperator) throws JaxenException
Description copied from interface:XPathFactoryReturns a new XPath relational expression.- Specified by:
createRelationalExprin 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 rhsorlhs != 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:XPathFactoryReturns a new XPath additive expression.- Specified by:
createAdditiveExprin interfaceXPathFactory- 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
public BinaryExpr createMultiplicativeExpr(Expr lhs, Expr rhs, int multiplicativeOperator) throws JaxenException
Description copied from interface:XPathFactoryReturns a new XPath multiplicative expression.- Specified by:
createMultiplicativeExprin 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
public Expr createUnaryExpr(Expr expr, int unaryOperator) throws JaxenException
Description copied from interface:XPathFactoryReturns a new XPath unary expression.- Specified by:
createUnaryExprin interfaceXPathFactory- Parameters:
expr- the expression to be negatedunaryOperator-Operator.NEGATIVE- Returns:
- exprorexpr- Throws:
JaxenException
-
createUnionExpr
public UnionExpr createUnionExpr(Expr lhs, Expr rhs) throws JaxenException
Description copied from interface:XPathFactoryReturns a new XPath union expression.- Specified by:
createUnionExprin interfaceXPathFactory- Parameters:
lhs- the left hand side of the expressionrhs- the right hand side of the expression- Returns:
lhs | rhs- Throws:
JaxenException
-
createFilterExpr
public FilterExpr createFilterExpr(Expr expr) throws JaxenException
Description copied from interface:XPathFactoryReturns a new XPath filter expression.- Specified by:
createFilterExprin 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(java.lang.String prefix, java.lang.String functionName) throws JaxenException
Description copied from interface:XPathFactoryCreate a new function call expression.- Specified by:
createFunctionCallExprin 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
public NumberExpr createNumberExpr(int number) throws JaxenException
Description copied from interface:XPathFactoryCreate a number expression.- Specified by:
createNumberExprin interfaceXPathFactory- Parameters:
number- the value- Returns:
- a number expression wrapping that value
- Throws:
JaxenException
-
createNumberExpr
public NumberExpr createNumberExpr(double number) throws JaxenException
Description copied from interface:XPathFactoryCreate a number expression.- Specified by:
createNumberExprin interfaceXPathFactory- Parameters:
number- the value- Returns:
- a number expression wrapping that value
- Throws:
JaxenException
-
createLiteralExpr
public LiteralExpr createLiteralExpr(java.lang.String literal) throws JaxenException
Description copied from interface:XPathFactoryCreate a string literal expression.- Specified by:
createLiteralExprin interfaceXPathFactory- Parameters:
literal- the value- Returns:
- a literal expression wrapping that value
- Throws:
JaxenException
-
createVariableReferenceExpr
public VariableReferenceExpr createVariableReferenceExpr(java.lang.String prefix, java.lang.String variable) throws JaxenException
Description copied from interface:XPathFactoryCreate a new variable reference expression.- Specified by:
createVariableReferenceExprin interfaceXPathFactory- Parameters:
prefix- the namespace prefix of the variablevariable- the local name of the variable- Returns:
- a variable expression
- Throws:
JaxenException
-
createNameStep
public Step createNameStep(int axis, java.lang.String prefix, java.lang.String localName) throws JaxenException
Description copied from interface:XPathFactoryCreate a step with a named node-test.- Specified by:
createNameStepin 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- ifaxisis not one of the axis constants????
-
createTextNodeStep
public Step createTextNodeStep(int axis) throws JaxenException
Description copied from interface:XPathFactoryCreate a step with atext()node-test.- Specified by:
createTextNodeStepin interfaceXPathFactory- Parameters:
axis- the axis to create thetext()node-test on- Returns:
- a text node step
- Throws:
JaxenException- ifaxisis not one of the axis constants????
-
createCommentNodeStep
public Step createCommentNodeStep(int axis) throws JaxenException
Description copied from interface:XPathFactoryCreate a step with acomment()node-test.- Specified by:
createCommentNodeStepin interfaceXPathFactory- Parameters:
axis- the axis to create thecomment()node-test on- Returns:
- a comment node step
- Throws:
JaxenException- ifaxisis not one of the axis constants????
-
createAllNodeStep
public Step createAllNodeStep(int axis) throws JaxenException
Description copied from interface:XPathFactoryCreate a step with a node() node-test.- Specified by:
createAllNodeStepin interfaceXPathFactory- Parameters:
axis- the axis to create the node-test on- Returns:
- an all node step
- Throws:
JaxenException- ifaxisis not one of the axis constants????
-
createProcessingInstructionNodeStep
public Step createProcessingInstructionNodeStep(int axis, java.lang.String piName) throws JaxenException
Description copied from interface:XPathFactoryCreate a step with aprocessing-instruction()node-test.- Specified by:
createProcessingInstructionNodeStepin 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- ifaxisis not one of the axis constants????
-
createPredicate
public Predicate createPredicate(Expr predicateExpr) throws JaxenException
Description copied from interface:XPathFactoryCreate from the supplied expression.- Specified by:
createPredicatein interfaceXPathFactory- Parameters:
predicateExpr- the expression to evaluate in the predicate- Returns:
- a predicate
- Throws:
JaxenException
-
getIterableAxis
protected IterableAxis getIterableAxis(int axis) throws JaxenException
- Throws:
JaxenException
-
createPredicateSet
public PredicateSet createPredicateSet() throws JaxenException
Description copied from interface:XPathFactoryCreate an empty predicate set.- Specified by:
createPredicateSetin interfaceXPathFactory- Returns:
- an empty predicate set
- Throws:
JaxenException
-
-