Class SqlMetaLogExpr

java.lang.Object
org.sqlproc.engine.impl.SqlMetaLogExpr
All Implemented Interfaces:
SqlMetaElement, SqlMetaLogOperand

class SqlMetaLogExpr extends Object implements SqlMetaElement, SqlMetaLogOperand
A META SQL sub-element.

Schematically:

 SqlMetaLogExpr
     SqlMetaIdent
     SqlMetaConst
     SqlMetaLogOperator
     SqlMetaLogExpr for embedded ()
 
Author:
Vladimir Hudec
  • Field Details

    • logger

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

      private boolean not
      The indicator, which reverses the final logical value.
    • elements

      The list of sub-elements based on ANTLR grammar. The evaluation of these sub-elements is little bit different compared to the evaluation of sub-elements in other SqlMetaXXX components. Every sub-element must bu true, not not-empty.
  • Constructor Details

    • SqlMetaLogExpr

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

      SqlMetaLogExpr(boolean not)
      Creates a new instance of this entity. Used from inside ANTLR parser.
      Parameters:
      not - the indicator, which reverses the final logical value
  • Method Details

    • addElement

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

      boolean isNot()
      Returns the indicator, which reverses the final logical value.
      Returns:
      the indicator value
    • setNot

      void setNot(boolean not)
      Sets the indicator, which reverses the final logical value.
      Parameters:
      not - a new value of the indicator
    • processExpression

      public boolean processExpression(SqlProcessContext ctx)
      The main contract to evaluate a logical value of META SQL sub-elements.
      Specified by:
      processExpression in interface SqlMetaLogOperand
      Parameters:
      ctx - the context for a dynamic ANSI SQL Query generation
      Returns:
      a logical value
    • 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