Package org.sqlproc.engine.impl
Class SqlMetaAndOr
java.lang.Object
org.sqlproc.engine.impl.SqlMetaAndOr
- All Implemented Interfaces:
SqlMetaElement
A META SQL sub-element.
Schematically:
SqlMetaAndOr { SqlMetaIfItem | SqlMetaIfItem...} {& SqlMetaIfItem | SqlMetaIfItem...} {| SqlMetaIfItem | SqlMetaIfItem...}
- Author:
- Vladimir Hudec
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enum
The enumeration of types. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) List
<SqlMetaIfItem> The list of sub-elements based on ANTLR grammar.(package private) final org.slf4j.Logger
The internal slf4j logger.(package private) SqlMetaAndOr.Type
The type if this element.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 -
Method Summary
Modifier and TypeMethodDescription(package private) void
addElement
(SqlMetaIfItem element) Adds a new sub-element.(package private) String
Returns one of the next ANSI SQL fragments:AND
orOR
.process
(SqlProcessContext ctx) The main contract for a dynamic ANSI SQL Query generation.
-
Field Details
-
logger
final org.slf4j.Logger loggerThe internal slf4j logger. -
elements
List<SqlMetaIfItem> elementsThe list of sub-elements based on ANTLR grammar. -
type
SqlMetaAndOr.Type typeThe type if this element. It controls, how the related ANSI SQL fragment is added to the final ANSI SQL.
-
-
Constructor Details
-
SqlMetaAndOr
SqlMetaAndOr(SqlMetaAndOr.Type type) Creates a new instance. It's used from inside ANTLR parser.- Parameters:
type
- the type, which is used to control, how the related ANSI SQL fragment is added to the final ANSI SQL.
-
-
Method Details
-
addElement
Adds a new sub-element. It's used from inside ANTLR parser.- Parameters:
element
- new sub-element, based on ANTLR grammar
-
getPrefix
String getPrefix()Returns one of the next ANSI SQL fragments:AND
orOR
.- Returns:
- the ANSI SQL fragment based on the type of this element
-
process
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
-