org.exolab.adaptx.xpath.engine
Class Parser

java.lang.Object
  extended by org.exolab.adaptx.xpath.engine.Parser

public class Parser
extends java.lang.Object

A class for parsing expression strings

Version:
$Revision: 4090 $ $Date: 2004-01-23 20:21:23 -0500 (Fri, 23 Jan 2004) $
Author:
Keith Visco

Constructor Summary
Parser()
           
 
Method Summary
static XPathExpression createExpr(java.lang.String exprString)
          Creates an Expr from the given String
static FunctionCall createFunctionCall(java.lang.String name)
          Creates the appropriate FunctionCall based on the given name
static XPathExpression createLiteralExpr(java.lang.String literal)
          Creates a literal expression, which simply evaluates to the given string literal.
static MatchExpression createMatchExpr(java.lang.String matchString)
          Parses the a pattern String into a MatchExpr
static PathExpr createPathExpr(java.lang.String pattern)
          Creates a PathExpr from the string argument.
static SelectExpr createSelectExpr(java.lang.String selectString)
          Parses the a pattern String into a SelectExpr
static UnionExpr createUnionExpr(java.lang.String pattern)
          Creates a UnionExpr from the given string argument.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser()
Method Detail

createExpr

public static XPathExpression createExpr(java.lang.String exprString)
                                  throws XPathException
Creates an Expr from the given String

Parameters:
exprString - the String to create the Expr from
Returns:
the new Expr
Throws:
InvalidExprException - when a parsing error occurs
XPathException

createLiteralExpr

public static XPathExpression createLiteralExpr(java.lang.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.

createFunctionCall

public static FunctionCall createFunctionCall(java.lang.String name)
                                       throws XPathException
Creates the appropriate FunctionCall based on the given name

Parameters:
name - the name of the function to call
params - the List of Expr paramaters for the function call
Returns:
the new FunctionCall
Throws:
XPathException

createMatchExpr

public static MatchExpression createMatchExpr(java.lang.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
Throws:
InvalidExprException
XPathException

createPathExpr

public static PathExpr createPathExpr(java.lang.String pattern)
                               throws XPathException
Creates a PathExpr from the string argument.

Parameters:
pattern - the string to create the PathExpr from
Returns:
the new PathExpr
Throws:
InvalidExprException
XPathException

createSelectExpr

public static SelectExpr createSelectExpr(java.lang.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
Throws:
XSLException
XPathException

createUnionExpr

public static UnionExpr createUnionExpr(java.lang.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
Throws:
InvalidExprException
XPathException

main

public static void main(java.lang.String[] args)
                 throws XPathException
Throws:
XPathException