org.exolab.adaptx.xpath.engine

Class Parser


public class Parser
extends java.lang.Object

A class for parsing expression strings
Version:
$Revision: 1.2 $ $Date: 2003/05/13 07:59:08 $
Author:
Keith Visco

Method Summary

static XPathExpression
createExpr(String exprString)
Creates an Expr from the given String
static FunctionCall
createFunctionCall(String name)
Creates the appropriate FunctionCall based on the given name
static XPathExpression
createLiteralExpr(String literal)
Creates a literal expression, which simply evaluates to the given string literal.
static MatchExpression
createMatchExpr(String matchString)
Parses the a pattern String into a MatchExpr
static PathExpr
createPathExpr(String pattern)
Creates a PathExpr from the string argument.
static SelectExpr
createSelectExpr(String selectString)
Parses the a pattern String into a SelectExpr
static UnionExpr
createUnionExpr(String pattern)
Creates a UnionExpr from the given string argument.
static void
main(String[] args)

Method Details

createExpr

public static XPathExpression createExpr(String exprString)
            throws XPathException
Creates an Expr from the given String
Parameters:
exprString - the String to create the Expr from
Returns:
the new Expr

createFunctionCall

public static FunctionCall createFunctionCall(String name)
            throws XPathException
Creates the appropriate FunctionCall based on the given name
Parameters:
name - the name of the function to call
Returns:
the new FunctionCall

createLiteralExpr

public static XPathExpression createLiteralExpr(String literal)
Creates a literal expression, which simply evaluates to the given string literal.
Parameters:
literal - the string literal the literal expression should evaluate to.
Returns:
an XPathExpression which will evaluate to the given string literal.

createMatchExpr

public static MatchExpression createMatchExpr(String matchString)
            throws XPathException
Parses the a pattern String into a MatchExpr
Parameters:
matchString - the pattern string to create the MatchExpr from
Returns:
the new MatchExpr

createPathExpr

public static PathExpr createPathExpr(String pattern)
            throws XPathException
Creates a PathExpr from the string argument.
Parameters:
pattern - the string to create the PathExpr from
Returns:
the new PathExpr

createSelectExpr

public static SelectExpr createSelectExpr(String selectString)
            throws XPathException
Parses the a pattern String into a SelectExpr
Parameters:
selectString - the pattern string to create the SelectExpr from
Returns:
the new SelectExpr

createUnionExpr

public static UnionExpr createUnionExpr(String pattern)
            throws XPathException
Creates a UnionExpr from the given string argument.
Parameters:
pattern - the string to create the UnionExpr from
Returns:
the new UnionExpr

main

public static void main(String[] args)
            throws XPathException