org.datanucleus.query.compiler
Class JPQLParser

java.lang.Object
  extended by org.datanucleus.query.compiler.JPQLParser
All Implemented Interfaces:
Parser

public class JPQLParser
extends java.lang.Object
implements Parser

Implementation of a parser for JPQL query language. Generates Node tree(s) by use of the various parseXXX() methods.


Constructor Summary
JPQLParser(java.util.Map options, java.util.Map params)
          Constructor for a JPQL Parser.
 
Method Summary
 Node parse(java.lang.String expression)
           
 Node[] parseFrom(java.lang.String expression)
           
 Node[] parseOrder(java.lang.String expression)
           
 Node[][] parseParameters(java.lang.String expression)
           
 Node[] parseResult(java.lang.String expression)
           
 Node[] parseTupple(java.lang.String expression)
           
 Node[] parseUpdate(java.lang.String expression)
           
 Node parseVariable(java.lang.String expression)
           
 Node[][] parseVariables(java.lang.String expression)
           
protected  void processAdditiveExpression()
           
protected  boolean processLiteral()
          A literal is one value of any type.
protected  void processMultiplicativeExpression()
           
protected  void processPrimary()
          Parses the primary.
protected  void processUnaryExpression()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPQLParser

public JPQLParser(java.util.Map options,
                  java.util.Map params)
Constructor for a JPQL Parser.

Parameters:
options - parser options
params - Map of parameter values keyed by name/number
Method Detail

parse

public Node parse(java.lang.String expression)
Specified by:
parse in interface Parser

parseVariable

public Node parseVariable(java.lang.String expression)
Specified by:
parseVariable in interface Parser

parseFrom

public Node[] parseFrom(java.lang.String expression)
Specified by:
parseFrom in interface Parser

parseUpdate

public Node[] parseUpdate(java.lang.String expression)
Specified by:
parseUpdate in interface Parser

parseOrder

public Node[] parseOrder(java.lang.String expression)
Specified by:
parseOrder in interface Parser

parseResult

public Node[] parseResult(java.lang.String expression)
Specified by:
parseResult in interface Parser

parseTupple

public Node[] parseTupple(java.lang.String expression)
Specified by:
parseTupple in interface Parser

parseVariables

public Node[][] parseVariables(java.lang.String expression)
Specified by:
parseVariables in interface Parser

parseParameters

public Node[][] parseParameters(java.lang.String expression)
Specified by:
parseParameters in interface Parser

processAdditiveExpression

protected void processAdditiveExpression()

processMultiplicativeExpression

protected void processMultiplicativeExpression()

processUnaryExpression

protected void processUnaryExpression()

processPrimary

protected void processPrimary()
Parses the primary. First look for a literal (e.g. "text"), then an identifier(e.g. variable) In the next step, call a function, if executing a function, on the literal or the identifier found.


processLiteral

protected boolean processLiteral()
A literal is one value of any type. Supported literals are of types String, Floating Point, Integer, Character, Boolean and null e.g. 'J', "String", 1, 1.8, true, false, null.

Returns:
The compiled literal


Copyright © 2011. All Rights Reserved.