|
||||||||||
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 DataType
s of
QueryValueExpression
s based on the DataType
s
already been resolved for the ValueExpressionColumn
s.
Note: the QueryStatement
has to be processed by the
TableReferenceResolver
before.
Field Summary | |
---|---|
static java.lang.String |
ERROR_CODE_DATATYPE_UNRESOLVED
Error code constant - not a message, data type unresolved |
static java.lang.String |
ERROR_CODE_DATATYPES_INCOMPATIBLE
Error code constant - not a message, incompatible data types |
static java.lang.String |
ERROR_CODE_VARIABLE_TYPE_UNCLEAR
Error 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 PostParseProcessor with the arguments
provided in the given PostParseProcessorConfiguration . |
java.util.Map |
getParsedObjectsReplacementMap()
Returns a Map containing parsed SQLQueryObject s mapped to
either the SQLQueryObject that replaces it, or is mapped to
null , if that parsed object simply is to be removed. |
java.lang.Class[] |
getProcessCandidateTypes()
This DatTypeResolver 's candidate types are:
QueryStatement
ValueExpression
|
java.util.List |
process(SQLQueryObject sqlQuery)
The call back method invoked for each of the SQLQueryObject s 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() |
void |
resetState()
If this PostParseProcessor 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 . |
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:
QueryStatement
ValueExpression
getProcessCandidateTypes
in interface PostParseProcessor
Class[]
of SQLObject
typesorg.eclipse.datatools.sqltools.parsers.sql.query.postparse.PostParseProcessor#getProcessCandidateTypes()
public void config(PostParseProcessorConfiguration config)
PostParseProcessor
PostParseProcessor
with the arguments
provided in the given PostParseProcessorConfiguration
.
config
in interface PostParseProcessor
config
- the configuration arguments that can be consumed by this
PostParseProcessor
public java.util.List process(SQLQueryObject sqlQuery) throws SQLParserException
PostParseProcessor
SQLQueryObject
s 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 PostParseProcessor
sqlQuery
- 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()
PostParseProcessor
PostParseProcessor
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 PostParseProcessor
org.eclipse.datatools.sqltools.parsers.sql.query.postparse.PostParseProcessor#resetState()
public java.util.Map getParsedObjectsReplacementMap()
PostParseProcessor
SQLQueryObject
s 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
SQLQueryObject
s 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 SQLQueryObject
s can be
removed from the parser's parsed-element-list and therefore will not be
subject to further post parse processing of other
PostParseProcessor
s.
SQLQueryObject
originally created by parserSQLQueryObject
created by this
PostParseProcessor
to substitute the originally
created by the parser
getParsedObjectsReplacementMap
in interface PostParseProcessor
SQLQueryObject
s 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 |