org.sqlproc.engine.impl
Class SqlProcessContext

java.lang.Object
  extended by org.sqlproc.engine.impl.SqlProcessContext
All Implemented Interfaces:
SqlFeature

 class SqlProcessContext
extends java.lang.Object
implements SqlFeature

The crate (design pattern) for all input parameters for SqlMetaStatement.process(Object, Object, List, Map). Also can work as a context for a dynamic ANSI SQL Query generation, which the main contract is SqlMetaElement.process(SqlProcessContext).

Author:
Vladimir Hudec

Field Summary
(package private)  java.lang.Object dynamicInputValues
          The SQL statement dynamic parameters.
(package private)  java.util.Map<java.lang.String,java.lang.Object> features
          The configuration of SQL Processor - optional features.
(package private)  java.util.List<SqlOrder> order
          TThe list of ordering directives.
(package private)  java.lang.Object staticInputValues
          The SQL statement static parameters.
 
Fields inherited from interface org.sqlproc.engine.SqlFeature
DEFAULT_LIKE_STRING, DEFAULT_SURROUND_QUERY_MIN_LEN, DEFAULT_WILDCARD_CHARACTER, LIKE_STRING, SURROUND_QUERY_LIKE, SURROUND_QUERY_MIN_LEN, WILDCARD_CHARACTER
 
Constructor Summary
SqlProcessContext(java.lang.Object dynamicInputValues, java.util.List<SqlOrder> order, java.util.Map<java.lang.String,java.lang.Object> features)
          Creates a new instance with empty static input values.
SqlProcessContext(java.lang.Object dynamicInputValues, java.lang.Object staticInputValues, java.util.List<SqlOrder> order, java.util.Map<java.lang.String,java.lang.Object> features)
          Creates a new instance.
 
Method Summary
 java.lang.String getFeature(java.lang.String name)
          Convenient method to obtain String feature based on the name.
 java.lang.Integer getFeatureAsInt(java.lang.String name)
          Convenient method to obtain Integer feature based on the name.
 SqlOrder.Order getOrder(int orderIndex)
          Convenient method to obtain the ordering rule based on index.
 int getOrderIndex(int orderId)
          Convenient method to obtain the index of the ordering rule.
 boolean isFeature(java.lang.String name)
          Convenient method to obtain boolean feature based on the name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dynamicInputValues

java.lang.Object dynamicInputValues
The SQL statement dynamic parameters.


staticInputValues

java.lang.Object staticInputValues
The SQL statement static parameters.


order

java.util.List<SqlOrder> order
TThe list of ordering directives.


features

java.util.Map<java.lang.String,java.lang.Object> features
The configuration of SQL Processor - optional features.

Constructor Detail

SqlProcessContext

SqlProcessContext(java.lang.Object dynamicInputValues,
                  java.util.List<SqlOrder> order,
                  java.util.Map<java.lang.String,java.lang.Object> features)
Creates a new instance with empty static input values.

Parameters:
dynamicInputValues - dynamic input values
order - ordering rules
features - optional features

SqlProcessContext

SqlProcessContext(java.lang.Object dynamicInputValues,
                  java.lang.Object staticInputValues,
                  java.util.List<SqlOrder> order,
                  java.util.Map<java.lang.String,java.lang.Object> features)
Creates a new instance.

Parameters:
dynamicInputValues - dynamic input values
staticInputValues - static input values
order - ordering rules
features - optional features
Method Detail

getFeature

public java.lang.String getFeature(java.lang.String name)
Convenient method to obtain String feature based on the name.

Specified by:
getFeature in interface SqlFeature
Parameters:
name - name of the feature
Returns:
value of the feature

isFeature

public boolean isFeature(java.lang.String name)
Convenient method to obtain boolean feature based on the name.

Specified by:
isFeature in interface SqlFeature
Parameters:
name - name of the feature
Returns:
value of the feature

getFeatureAsInt

public java.lang.Integer getFeatureAsInt(java.lang.String name)
Convenient method to obtain Integer feature based on the name.

Specified by:
getFeatureAsInt in interface SqlFeature
Parameters:
name - name of the feature
Returns:
value of the feature

getOrderIndex

public int getOrderIndex(int orderId)
Convenient method to obtain the index of the ordering rule.

Parameters:
orderId - order number
Returns:
index of the ordering rule

getOrder

public SqlOrder.Order getOrder(int orderIndex)
Convenient method to obtain the ordering rule based on index.

Parameters:
orderIndex - index of the ordering rule
Returns:
ordering rule


Copyright © 2010. All Rights Reserved.