Package org.sqlproc.engine.impl
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 Summary
Fields Modifier and Type Field Description (package private) 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_SEPARATOR, lCONST_PREFIX, lIDENT_PREFIX, OR_PREFIX, SET_PREFIX, VALUES_PREFIX, WHERE_PREFIX
-
-
Constructor Summary
Constructors Constructor Description SqlMetaLogExpr()
Creates a new instance.SqlMetaLogExpr(boolean not)
Creates a new instance of this entity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (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.
-
-
-
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
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.
-
-
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 interfaceSqlMetaLogOperand
- 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 interfaceSqlMetaElement
- Parameters:
ctx
- the crate for all input parameters and the context of processing
-
-