jd.xml.xslt.parser
Class PatternParser

java.lang.Object
  extended byjd.xml.xpath.parser.ExpressionParser
      extended byjd.xml.xslt.parser.PatternParser
All Implemented Interfaces:
TokenConstants

public class PatternParser
extends ExpressionParser
implements TokenConstants

A parser for XSLT patterns, XPath expressions and AttributeValueTemplates.


Field Summary
 
Fields inherited from interface jd.xml.xpath.parser.TokenConstants
AT, AXISNAME, BRACKET_CLOSE, BRACKET_OPEN, COMMA, DOT, DOTDOT, END_OF_EXPRESSION, EQUALS, GREATER, GREATER_EQUALS, LESS, LESS_EQUALS, LITERAL, MAX, MINUS, MULTIPLY, NAME, NOT_EQUALS, NUMBER, PARENTHESIS_CLOSE, PARENTHESIS_OPEN, PLUS, SLASH, SLASHSLASH, UNDEFINED, UNION, VARIABLE_REFERENCE
 
Constructor Summary
PatternParser()
          Cbeate a PatternParser with a own XsltParceContext.
PatternParser(XsltParseContext context)
          Create a PatternParser which uses the given XsltParseContext.
 
Method Summary
protected  Expression createFunction(Scanner scanner, String functionName, Expression[] arguments)
          Create a function call expression for a function with the given name and arguments.
(package private)  XsltParseContext getXsltParseContext()
           
 AttributeValue parseAttributeValue(String source)
           
 Expression parseExpression(String source)
           
 Pattern parsePattern(String source)
           
 void setParseListener(ParseListener parseListener)
          Set a ParseListener.
 
Methods inherited from class jd.xml.xpath.parser.ExpressionParser
getNamespaceUri, parseExpression, parseNodeNameTest, parseNodeTest, parseNodeTest, parseNodeTest, parseVariableReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternParser

public PatternParser()
Cbeate a PatternParser with a own XsltParceContext.


PatternParser

public PatternParser(XsltParseContext context)
Create a PatternParser which uses the given XsltParseContext.

Method Detail

getXsltParseContext

XsltParseContext getXsltParseContext()

setParseListener

public void setParseListener(ParseListener parseListener)
Set a ParseListener.


parseExpression

public Expression parseExpression(String source)
                           throws XPathParseException
Overrides:
parseExpression in class ExpressionParser
Throws:
XPathParseException

parsePattern

public Pattern parsePattern(String source)
                     throws XPathParseException
Throws:
XPathParseException

createFunction

protected Expression createFunction(Scanner scanner,
                                    String functionName,
                                    Expression[] arguments)
                             throws XPathParseException
Description copied from class: ExpressionParser
Create a function call expression for a function with the given name and arguments. Since xpath can be enhanced by adding more functions to the default function library this factory method gives derived parser the ability to influence the creation of the function when needed. The default implementation returns a simple FunctionCall object

Overrides:
createFunction in class ExpressionParser
Throws:
XPathParseException

parseAttributeValue

public AttributeValue parseAttributeValue(String source)
                                   throws XPathParseException
Throws:
XPathParseException