|
||||||||||
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.RoutineReferenceResolver
public class RoutineReferenceResolver
This class resolves and validates references to a SQL model stored procedure in a CALL statement during the post-parse processing (semantic processing) phase of parsing.
Constructor Summary | |
---|---|
RoutineReferenceResolver()
Constructs an instance of this class. |
|
RoutineReferenceResolver(Database database)
Constructs an instance of this class with the given SQL model database object. |
|
RoutineReferenceResolver(Database database,
java.lang.String defaultSchemaName)
Constructs an instance of this class using the given database and default schema name. |
Method Summary | |
---|---|
void |
config(PostParseProcessorConfiguration config)
Configures this post-parse process with the Database object and default schema name contained in the given configuration object. |
Database |
getDatabase()
Gets the current SQL model Database object. |
java.lang.String |
getDefaultSchemaName()
Gets the current default schema name. |
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()
Gets a list of classes that this processor is interested in. |
java.util.List |
process(SQLQueryObject queryObj)
Post-parse processes the given SQL query object. |
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 . |
void |
setDatabase(Database database)
Sets the SQL model Database object to use to find object references. |
void |
setDefaultSchemaName(java.lang.String defaultSchemaName)
Sets the default schema name to use to find SQL model object references. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RoutineReferenceResolver()
RoutineReferenceResolver(Database, String)
constructor in order to provide SQL model
information for validation.
public RoutineReferenceResolver(Database database)
RoutineReferenceResolver(Database, String)
constructor in order to provide SQL model
information for validation.
public RoutineReferenceResolver(Database database, java.lang.String defaultSchemaName)
aDB
- the SQL model Database object to use to locate objectsaDefaultSchemaName
- the default schema name to use to locate objectsMethod Detail |
---|
public Database getDatabase()
public void setDatabase(Database database)
database
- the SQL model Database to usepublic java.lang.String getDefaultSchemaName()
public void setDefaultSchemaName(java.lang.String defaultSchemaName)
defaultSchemaName
- the default schema name to usepublic java.lang.Class[] getProcessCandidateTypes()
getProcessCandidateTypes
in interface PostParseProcessor
org.eclipse.datatools.sqltools.parsers.sql.query.postparse.PostParseProcessor#getProcessCandidateTypes()
public void config(PostParseProcessorConfiguration config)
config
in interface PostParseProcessor
config
- the configuration object to usepublic java.util.List process(SQLQueryObject queryObj) throws SQLParserException
process
in interface PostParseProcessor
queryObj
- the SQL Query object to process
SQLParseErrorInfo
objects, with information about the error encountered,
must not be null
SQLParserException
- when the given object fails validationpublic 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 removedpublic 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |