| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.datatools.sqltools.parsers.sql.query.postparse.DataTypeResolver
public class DataTypeResolver
The DataTypeResolver resolves the DataTypes of
 QueryValueExpressions based on the DataTypes
 already been resolved for the ValueExpressionColumns.
 Note: the QueryStatement has to be processed by the
 TableReferenceResolver before.
| Field Summary | |
|---|---|
| static java.lang.String | ERROR_CODE_DATATYPE_UNRESOLVEDError code constant - not a message, data type unresolved | 
| static java.lang.String | ERROR_CODE_DATATYPES_INCOMPATIBLEError code constant - not a message, incompatible data types | 
| static java.lang.String | ERROR_CODE_VARIABLE_TYPE_UNCLEARError code constant - not a message, host variable/parameter data type unresolved | 
| Constructor Summary | |
|---|---|
| DataTypeResolver()Constructs a new DataTypeResolver. | |
| DataTypeResolver(boolean logError)Constructs a new DataTypeResolver. | |
| Method Summary | |
|---|---|
|  void | config(PostParseProcessorConfiguration config)Configures this PostParseProcessorwith the arguments
 provided in the givenPostParseProcessorConfiguration. | 
|  java.util.Map | getParsedObjectsReplacementMap()Returns a Map containing parsed SQLQueryObjects mapped to
 either theSQLQueryObjectthat replaces it, or is mapped tonull, if that parsed object simply is to be removed. | 
|  java.lang.Class[] | getProcessCandidateTypes()This DatTypeResolver's candidate types are:QueryStatementValueExpression | 
|  java.util.List | process(SQLQueryObject sqlQuery)The call back method invoked for each of the SQLQueryObjects in theSQLQueryObjectmodel
 instance returned by the parser, if theSQLQueryObjectcomplies with one of the types in theClass[]returned by
 thisPostParseProcessor.getProcessCandidateTypes() | 
|  void | resetState()If this PostParseProcessoris stateful within the context of
 oneQueryStatement, this method should reset the state, as
 it might be used for post parse processing of more than oneQueryStatement. | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final java.lang.String ERROR_CODE_DATATYPE_UNRESOLVED
public static final java.lang.String ERROR_CODE_VARIABLE_TYPE_UNCLEAR
public static final java.lang.String ERROR_CODE_DATATYPES_INCOMPATIBLE
| Constructor Detail | 
|---|
public DataTypeResolver()
DataTypeResolver.
public DataTypeResolver(boolean logError)
DataTypeResolver.
logError - if true errors will be logged to the console,
   default is true| Method Detail | 
|---|
public java.lang.Class[] getProcessCandidateTypes()
DatTypeResolver's candidate types are:
 QueryStatementValueExpression
getProcessCandidateTypes in interface PostParseProcessorClass[] of SQLObject typesorg.eclipse.datatools.sqltools.parsers.sql.query.postparse.PostParseProcessor#getProcessCandidateTypes()public void config(PostParseProcessorConfiguration config)
PostParseProcessorPostParseProcessor with the arguments
 provided in the given PostParseProcessorConfiguration.
config in interface PostParseProcessorconfig - the configuration arguments that can be consumed by this
        PostParseProcessor
public java.util.List process(SQLQueryObject sqlQuery)
                       throws SQLParserException
PostParseProcessorSQLQueryObjects in the SQLQueryObject model
 instance returned by the parser, if the SQLQueryObject
 complies with one of the types in the Class[] returned by
 this PostParseProcessor.getProcessCandidateTypes()
process in interface PostParseProcessorsqlQuery - instance of one of the types in the Class[]
                 returned by PostParseProcessor.getProcessCandidateTypes()
SQLParseErrorInfo
                 objects, with information about the error encountered,
                 must not be null
SQLParserException - if the error encountered is severe enough to
                 discard the instance of the SQLQueryObject model
                 returned by the parserpublic void resetState()
PostParseProcessorPostParseProcessor is stateful within the context of
 one QueryStatement, this method should reset the state, as
 it might be used for post parse processing of more than one
 QueryStatement.
 This method is invoked after the SQLParserManager
 bottom-up processed the SQLQueryObject elements of a
 QueryStatement up to the top/root-element - the
 QueryStatement object itself.
resetState in interface PostParseProcessororg.eclipse.datatools.sqltools.parsers.sql.query.postparse.PostParseProcessor#resetState()public java.util.Map getParsedObjectsReplacementMap()
PostParseProcessorSQLQueryObjects mapped to
 either the SQLQueryObject that replaces it, or is mapped to
 null, if that parsed object simply is to be removed.
 This method will be invoked after this PostParseProcessor
 is done processing one QueryStatement before the
 PostParseProcessor.resetState() method is called.
 This method should return a mapping, if during the post parse processing
 SQLQueryObjects are found that are determined to have been
 created by the parser mistakenly, because the parser did not have the
 knowledge about context or semantics. This then
 PostParseProcessor might create a substitution for it or
 simply delete it by mapping the original SQLQueryObject to
 null.
 By providing this mapping, invalid SQLQueryObjects can be
 removed from the parser's parsed-element-list and therefore will not be
 subject to further post parse processing of other
 PostParseProcessors.
 
 SQLQueryObject originally created by parserSQLQueryObject created by this
        PostParseProcessor to substitute the originally
                created by the parser
getParsedObjectsReplacementMap in interface PostParseProcessorSQLQueryObjects mapped to
                either the SQLQueryObject that replaces it to
                null, if that parsed object simply is to be removed| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||