org.apache.cayenne.template.parser

## Class SQLTemplateParser

- java.lang.Object
- - org.apache.cayenne.template.parser.SQLTemplateParser

- All Implemented Interfaces:
    SQLTemplateParserConstants, SQLTemplateParserTreeConstants

      public class SQLTemplateParser
      extends Object
      implements SQLTemplateParserTreeConstants, SQLTemplateParserConstants

  Parser of Cayenne Templates.
  Since:
    4.1

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `Token` | `jj_nt` Next token.
    `protected JJTSQLTemplateParserState` | `jjtree`
    `Token` | `token` Current token.
    `SQLTemplateParserTokenManager` | `token_source` Generated Token Manager.

    - ### Fields inherited from interface org.apache.cayenne.template.parser.SQLTemplateParserTreeConstants

      `JJTARRAY, JJTBLOCK, JJTBOOLSCALAR, JJTDIRECTIVE, JJTEXPRESSION, JJTFLOATSCALAR, JJTIFELSE, JJTINTSCALAR, JJTMETHOD, jjtNodeName, JJTSTRINGSCALAR, JJTTEXT, JJTVARIABLE, JJTVOID`

    - ### Fields inherited from interface org.apache.cayenne.template.parser.SQLTemplateParserConstants

      `ARGS, COMMA, DEC_DIGITS, DEC_FLT, DEFAULT, DIGIT, DOLLAR, DOT, DOUBLE_QUOTED_STRING, ELSE, END, EOF, ESC, EXPONENT, FALSE, FLOAT_LITERAL, FLT_SUFF, IDENTIFIER, IF, IN_SINGLE_LINE_COMMENT, INT_LITERAL, LBRACKET, LETTER, LSBRACKET, NOT_TEXT, RBRACKET, RSBRACKET, SHARP, SINGLE_LINE_COMMENT_END, SINGLE_QUOTED_STRING, STRING_ESC, TEXT, TEXT_OTHER, tokenImage, TRUE, WithinDoubleQuoteLiteral, WithinSingleQuoteLiteral`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SQLTemplateParser(InputStream stream)` Constructor with InputStream.
    `SQLTemplateParser(InputStream stream, String encoding)` Constructor with InputStream and supplied encoding
    `SQLTemplateParser(Reader stream)` Constructor.
    `SQLTemplateParser(SQLTemplateParserTokenManager tm)` Constructor with generated Token Manager.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `array()`
    `void` | `block()`
    `void` | `directive()`
    `void` | `disable_tracing()` Disable tracing.
    `void` | `enable_tracing()` Enable tracing.
    `void` | `expression()`
    `ParseException` | `generateParseException()` Generate ParseException.
    `Token` | `getNextToken()` Get the next Token.
    `Token` | `getToken(int index)` Get the specific Token.
    `void` | `ifElse()`
    `void` | `method()`
    `void` | `ReInit(InputStream stream)` Reinitialise.
    `void` | `ReInit(InputStream stream, String encoding)` Reinitialise.
    `void` | `ReInit(Reader stream)` Reinitialise.
    `void` | `ReInit(SQLTemplateParserTokenManager tm)` Reinitialise.
    `void` | `scalar()`
    `Node` | `template()`
    `void` | `text()`
    `boolean` | `trace_enabled()` Trace enabled.
    `void` | `variable()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### jjtree

          protected JJTSQLTemplateParserState jjtree

    - #### token_source

          public SQLTemplateParserTokenManager token_source

      Generated Token Manager.

    - #### token

          public Token token

      Current token.

    - #### jj_nt

          public Token jj_nt

      Next token.

  - ### Constructor Detail

    - #### SQLTemplateParser

          public SQLTemplateParser(InputStream stream)

      Constructor with InputStream.

    - #### SQLTemplateParser

          public SQLTemplateParser(InputStream stream,
                                   String encoding)

      Constructor with InputStream and supplied encoding

    - #### SQLTemplateParser

          public SQLTemplateParser(Reader stream)

      Constructor.

    - #### SQLTemplateParser

          public SQLTemplateParser(SQLTemplateParserTokenManager tm)

      Constructor with generated Token Manager.

  - ### Method Detail

    - #### template

          public final Node template()
                              throws ParseException

      Throws:
        `ParseException`

    - #### block

          public final void block()
                           throws ParseException

      Throws:
        `ParseException`

    - #### text

          public final void text()
                          throws ParseException

      Throws:
        `ParseException`

    - #### ifElse

          public final void ifElse()
                            throws ParseException

      Throws:
        `ParseException`

    - #### directive

          public final void directive()
                               throws ParseException

      Throws:
        `ParseException`

    - #### expression

          public final void expression()
                                throws ParseException

      Throws:
        `ParseException`

    - #### scalar

          public final void scalar()
                            throws ParseException

      Throws:
        `ParseException`

    - #### variable

          public final void variable()
                              throws ParseException

      Throws:
        `ParseException`

    - #### method

          public final void method()
                            throws ParseException

      Throws:
        `ParseException`

    - #### array

          public final void array()
                           throws ParseException

      Throws:
        `ParseException`

    - #### ReInit

          public void ReInit(InputStream stream)

      Reinitialise.

    - #### ReInit

          public void ReInit(InputStream stream,
                             String encoding)

      Reinitialise.

    - #### ReInit

          public void ReInit(Reader stream)

      Reinitialise.

    - #### ReInit

          public void ReInit(SQLTemplateParserTokenManager tm)

      Reinitialise.

    - #### getNextToken

          public final Token getNextToken()

      Get the next Token.

    - #### getToken

          public final Token getToken(int index)

      Get the specific Token.

    - #### generateParseException

          public ParseException generateParseException()

      Generate ParseException.

    - #### trace_enabled

          public final boolean trace_enabled()

      Trace enabled.

    - #### enable_tracing

          public final void enable_tracing()

      Enable tracing.

    - #### disable_tracing

          public final void disable_tracing()

      Disable tracing.

Copyright © 2001–2021 Apache Cayenne. All rights reserved.