org.jaxen.expr

Interface XPathFactory

public interface XPathFactory

An abstract factory used to create individual path component objects.
Method Summary
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 a comment() 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(String prefix, String functionName)
Create a new function call expression.
LiteralExprcreateLiteralExpr(String literal)
Create a string literal expression.
BinaryExprcreateMultiplicativeExpr(Expr lhs, Expr rhs, int multiplicativeOperator)
Returns a new XPath multiplicative expression.
StepcreateNameStep(int axis, String prefix, String localName)
Create a step with a named node-test.
NumberExprcreateNumberExpr(int number)
Create a number expression.
NumberExprcreateNumberExpr(double 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, String name)
Create a step with a processing-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 a text() 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(String prefix, String variableName)
Create a new variable reference expression.
XPathExprcreateXPath(Expr rootExpr)
Create a new XPathExpr from an Expr.

Method Detail

createAbsoluteLocationPath

public LocationPath createAbsoluteLocationPath()
Create a new empty absolute location path.

Returns: an empty absolute location path

Throws: JaxenException

createAdditiveExpr

public BinaryExpr createAdditiveExpr(Expr lhs, Expr rhs, int additiveOperator)
Returns a new XPath additive expression.

Parameters: lhs the left hand side of the expression rhs the right hand side of the expression additiveOperator Operator.ADD or Operator.SUBTRACT

Returns: lhs + rhs or lhs - rhs

Throws: JaxenException if the third argument is not Operator.ADD or Operator.SUBTRACT

createAllNodeStep

public Step createAllNodeStep(int axis)
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 if axis is not one of the axis constants????

createAndExpr

public BinaryExpr createAndExpr(Expr lhs, Expr rhs)
Returns a new XPath And expression.

Parameters: lhs the left hand side of the expression rhs the right hand side of the expression

Returns: lhs and rhs

Throws: JaxenException

createCommentNodeStep

public Step createCommentNodeStep(int axis)
Create a step with a comment() node-test.

Parameters: axis the axis to create the comment() node-test on

Returns: a comment node step

Throws: JaxenException if axis is not one of the axis constants????

createEqualityExpr

public BinaryExpr createEqualityExpr(Expr lhs, Expr rhs, int equalityOperator)
Returns a new XPath equality expression.

Parameters: lhs the left hand side of the expression rhs the right hand side of the expression equalityOperator Operator.EQUALS or Operator.NOT_EQUALS

Returns: lhs = rhs or lhs != rhs

Throws: JaxenException if the third argument is not Operator.EQUALS or Operator.NOT_EQUALS

createFilterExpr

public FilterExpr createFilterExpr(Expr expr)
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

public FunctionCallExpr createFunctionCallExpr(String prefix, String functionName)
Create a new function call expression.

Parameters: prefix the namespace prefix of the function functionName the local name of the function

Returns: a function with an empty argument list

Throws: JaxenException

createLiteralExpr

public LiteralExpr createLiteralExpr(String literal)
Create a string literal expression.

Parameters: number the value

Returns: a literal expression wrapping that value

Throws: JaxenException

createMultiplicativeExpr

public BinaryExpr createMultiplicativeExpr(Expr lhs, Expr rhs, int multiplicativeOperator)
Returns a new XPath multiplicative expression.

Parameters: lhs the left hand side of the expression rhs the right hand side of the expression multiplicativeOperator Operator.MULTIPLY, Operator.DIV, or Operator.MOD

Returns: lhs * rhs, lhs div rhs, or lhs mod rhs

Throws: JaxenException if the third argument is not a multiplicative operator constant

createNameStep

public Step createNameStep(int axis, String prefix, String localName)
Create a step with a named node-test.

Parameters: axis the axis to create the name-test on prefix the namespace prefix for the test localName the local name for the test

Returns: a name step

Throws: JaxenException if axis is not one of the axis constants????

createNumberExpr

public NumberExpr createNumberExpr(int number)
Create a number expression.

Parameters: number the value

Returns: a number expression wrapping that value

Throws: JaxenException

createNumberExpr

public NumberExpr createNumberExpr(double number)
Create a number expression.

Parameters: number the value

Returns: a number expression wrapping that value

Throws: JaxenException

createOrExpr

public BinaryExpr createOrExpr(Expr lhs, Expr rhs)
Returns a new XPath Or expression.

Parameters: lhs the left hand side of the expression rhs the right hand side of the expression

Returns: lhs or rhs

Throws: JaxenException

createPathExpr

public PathExpr createPathExpr(FilterExpr filterExpr, LocationPath locationPath)
Create a new path expression.

Parameters: filterExpr the filter expression that starts the path expression locationPath the location path that follows the filter expression

Returns: a path expression formed by concatenating the two arguments

Throws: JaxenException

createPredicate

public Predicate createPredicate(Expr predicateExpr)
Create from the supplied expression.

Parameters: the expression to evaluate in the predicate

Returns: a predicate

Throws: JaxenException

createPredicateSet

public PredicateSet createPredicateSet()
Create an empty predicate set.

Returns: an empty predicate set

Throws: JaxenException

createProcessingInstructionNodeStep

public Step createProcessingInstructionNodeStep(int axis, String name)
Create a step with a processing-instruction() node-test.

Parameters: axis the axis to create the processing-instruction() node-test on name the target to match, may be empty

Returns: a processing instruction node step

Throws: JaxenException if axis is not one of the axis constants????

createRelationalExpr

public BinaryExpr createRelationalExpr(Expr lhs, Expr rhs, int relationalOperator)
Returns a new XPath relational expression.

Parameters: lhs the left hand side of the expression rhs the right hand side of the expression relationalOperator Operator.LESS_THAN, Operator.GREATER_THAN, Operator.LESS_THAN_EQUALS, or Operator.GREATER_THAN_EQUALS

Returns: lhs relationalOperator rhs or lhs != rhs

Throws: JaxenException if the third argument is not a relational operator constant

createRelativeLocationPath

public LocationPath createRelativeLocationPath()
Create a new empty relative location path.

Returns: an empty relative location path

Throws: JaxenException

createTextNodeStep

public Step createTextNodeStep(int axis)
Create a step with a text() node-test.

Parameters: axis the axis to create the text() node-test on

Returns: a text node step

Throws: JaxenException if axis is not one of the axis constants????

createUnaryExpr

public Expr createUnaryExpr(Expr expr, int unaryOperator)
Returns a new XPath unary expression.

Parameters: expr the expression to be negated unaryOperator Operator.NEGATIVE

Returns: - expr or expr

Throws: JaxenException

createUnionExpr

public UnionExpr createUnionExpr(Expr lhs, Expr rhs)
Returns a new XPath union expression.

Parameters: lhs the left hand side of the expression rhs the right hand side of the expression

Returns: lhs | rhs

Throws: JaxenException

createVariableReferenceExpr

public VariableReferenceExpr createVariableReferenceExpr(String prefix, String variableName)
Create a new variable reference expression.

Parameters: prefix the namespace prefix of the variable functionName the local name of the variable

Returns: a variable expression

Throws: JaxenException

createXPath

public XPathExpr createXPath(Expr rootExpr)
Create a new XPathExpr from an Expr.

Parameters: rootExpr the expression wrapped by the resuolting XPathExpr

Returns: an XPathExpr wrapping the root expression

Throws: JaxenException