org.sqlproc.engine.impl
Class SqlMetaLogExpr

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

 class SqlMetaLogExpr
extends java.lang.Object
implements SqlMetaElement, SqlMetaLogOperand

A META SQL sub-element.

Schematically:

 SqlMetaLogExpr
     SqlMetaIdent
     SqlMetaConst
     SqlMetaLogOperator
     SqlMetaLogExpr for embedded ()
 

Author:
Vladimir Hudec

Field Summary
(package private)  java.util.List<SqlMetaLogOperand> elements
          The list of sub-elements based on ANTLR grammar.
(package private)  org.slf4j.Logger logger
          The internal slf4j logger.
private  boolean not
          The indicator, which reverses the final logical value.
 
Fields inherited from interface org.sqlproc.engine.impl.SqlMetaElement
AND_PREFIX, CONST_PREFIX, IDENT_PREFIX, IDENT_PREFIX_LEN, IDENT_SEPARATOR, OR_PREFIX
 
Constructor Summary
SqlMetaLogExpr()
          Creates a new instance.
SqlMetaLogExpr(boolean not)
          Creates a new instance of this entity.
 
Method Summary
(package private)  void addElement(SqlMetaLogOperand element)
          Adds a new sub-element.
(package private)  boolean isNot()
          Returns the indicator, which reverses the final logical value.
 SqlProcessResult process(SqlProcessContext ctx)
          The main contract for a dynamic ANSI SQL Query generation.
 boolean processExpression(SqlProcessContext ctx)
          The main contract to evaluate a logical value of META SQL sub-elements.
(package private)  void setNot(boolean not)
          Sets the indicator, which reverses the final logical value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

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


not

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


elements

java.util.List<SqlMetaLogOperand> 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 Detail

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 Detail

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


Copyright © 2010. All Rights Reserved.