Class SqlMetaIf

java.lang.Object
org.sqlproc.engine.impl.SqlMetaIf
All Implemented Interfaces:
SqlMetaElement

class SqlMetaIf extends Object implements SqlMetaElement
A META SQL sub-element.

Schematically:

 SqlMetaIf 
     {? SqlMetaLogExpr | SqlMetaIfItem | SqlMetaIfItem...}
 
Author:
Vladimir Hudec
  • Field Details

    • logger

      final org.slf4j.Logger logger
      The internal slf4j logger.
    • elements

      List<SqlMetaIfItem> elements
      The list of maximum 2 sub-elements based on ANTLR grammar.
    • expression

      SqlMetaLogExpr expression
      The logical expression. Based on the value of this expression the first or the second sub-element will become a part of the final ANSI SQL.
  • Constructor Details

    • SqlMetaIf

      SqlMetaIf()
      Creates a new instance. It's used from inside ANTLR parser.
  • Method Details

    • addElement

      void addElement(SqlMetaIfItem element)
      Adds a new sub-element. It's used from inside ANTLR parser.
      Parameters:
      element - new sub-element, based on ANTLR grammar
    • setExpression

      void setExpression(SqlMetaLogExpr expression)
      Sets a logical expression. It's used from inside ANTLR parser. Based on the value of this expression the first or the second sub-element will become a part of the final ANSI SQL.
      Parameters:
      expression - the new value of logical expression
    • process

      public SqlProcessResult process(SqlProcessContext ctx)
      The main contract for a dynamic ANSI SQL Query generation. Also known as a META SQL processing. The composite pattern main contract. All ANTLR grammar based elements must implement this contract.
      Specified by:
      process in interface SqlMetaElement
      Parameters:
      ctx - the crate for all input parameters and the context of processing