|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.sequencer.ddl.StandardDdlParser
org.modeshape.sequencer.ddl.dialect.oracle.OracleDdlParser
public class OracleDdlParser
Oracle-specific DDL Parser. Includes custom data types as well as custom DDL statements.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.modeshape.sequencer.ddl.dialect.oracle.OracleDdlConstants |
---|
OracleDdlConstants.OracleDataTypes, OracleDdlConstants.OracleStatementStartPhrases |
Nested classes/interfaces inherited from interface org.modeshape.sequencer.ddl.DdlConstants |
---|
DdlConstants.AstNodeNames, DdlConstants.DataTypes, DdlConstants.DropBehavior, DdlConstants.MatchType, DdlConstants.Problems, DdlConstants.ReferencialAction, DdlConstants.StatementStartPhrases |
Field Summary |
---|
Fields inherited from interface org.modeshape.sequencer.ddl.dialect.oracle.OracleDdlConstants |
---|
CUSTOM_KEYWORDS |
Fields inherited from interface org.modeshape.sequencer.ddl.DdlConstants |
---|
ALTER, CHECK, COLUMN, COMMA, CONSTRAINT, CONSTRAINT_C, CONSTRAINT_FK, CONSTRAINT_PK, CONSTRAINT_UC, CREATE, DECLARE, DEFAULT_ID_CURRENT_USER, DEFAULT_ID_DATETIME, DEFAULT_ID_LITERAL, DEFAULT_ID_NULL, DEFAULT_ID_SESSION_USER, DEFAULT_ID_SYSTEM_USER, DEFAULT_ID_UNDEFINED, DEFAULT_ID_USER, DEFAULT_TERMINATOR, DELETE, DROP, FOREIGN, FOREIGN_KEY, GIGA, GRANT, INDEX, INSERT, KEY, KILO, L_PAREN, L_SQUOTE, MEGA, MISSING_TERMINATOR_NODE_LITERAL, OFF, ON, PERIOD, PRIMARY, PRIMARY_KEY, R_PAREN, REVOKE, SCHEMA, SELECT, SEMICOLON, SET, SPACE, SQL_92_RESERVED_WORDS, TABLE, UNIQUE, UPDATE, VIEW |
Constructor Summary | |
---|---|
OracleDdlParser()
|
Method Summary | |
---|---|
protected List<String> |
getCustomDataTypeStartWords()
Returns a list of custom data type start words which can be used to help identify a column definition sub-statement. |
String |
getId()
Get the identifier for this parser. |
String[] |
getIdentifyingKeywords()
|
protected Name[] |
getValidSchemaChildTypes()
|
AstNode |
handleUnknownToken(DdlTokenStream tokens,
String tokenValue)
Utility method subclasses can override to check unknown tokens and perform additional node manipulation. |
protected void |
initializeTokenStream(DdlTokenStream tokens)
Method called by StandardDdlParser.score(String, String, DdlParserScorer) and StandardDdlParser.parse(String, AstNode, Object) to initialize
the token stream , giving subclasses a chance to register
key words and statement start phrases . |
protected AstNode |
parseAlterStatement(DdlTokenStream tokens,
AstNode parentNode)
Parses DDL ALTER statement based on SQL 92 specifications. |
protected AstNode |
parseAlterTableStatement(DdlTokenStream tokens,
AstNode parentNode)
Parses DDL ALTER TABLE AstNode based on SQL 92 specifications. |
protected void |
parseColumns(DdlTokenStream tokens,
AstNode tableNode,
boolean isAlterTable)
Utility method designed to parse columns within an ALTER TABLE ADD statement. |
protected AstNode |
parseCreateFunctionStatement(DdlTokenStream tokens,
AstNode parentNode)
Parses DDL CREATE FUNCTION statement |
protected AstNode |
parseCreateProcedureStatement(DdlTokenStream tokens,
AstNode parentNode)
Parses DDL CREATE PROCEDURE statement |
protected AstNode |
parseCreateSchemaStatement(DdlTokenStream tokens,
AstNode parentNode)
Parses DDL CREATE SCHEMA AstNode based on SQL 92 specifications. |
protected AstNode |
parseCreateStatement(DdlTokenStream tokens,
AstNode parentNode)
Parses DDL CREATE statement based on SQL 92 specifications. |
protected AstNode |
parseCreateViewStatement(DdlTokenStream tokens,
AstNode parentNode)
Parses DDL CREATE VIEW AstNode basedregisterStatementStartPhrase on SQL 92 specifications. |
protected AstNode |
parseCustomStatement(DdlTokenStream tokens,
AstNode parentNode)
Catch-all method to parse unknown (not registered or handled by sub-classes) statements. |
protected AstNode |
parseDropStatement(DdlTokenStream tokens,
AstNode parentNode)
Parses DDL DROP AstNode based on SQL 92 specifications. |
protected AstNode |
parseGrantStatement(DdlTokenStream tokens,
AstNode parentNode)
Parses DDL GRANT statement AstNode based on SQL 92 specifications. |
protected AstNode |
parseMaterializedViewStatement(DdlTokenStream tokens,
AstNode parentNode)
Parses DDL CREATE MATERIALIZED VIEW statement This could either be a standard view or a VIEW LOG ON statement. |
protected AstNode |
parseRevokeStatement(DdlTokenStream tokens,
AstNode parentNode)
|
protected AstNode |
parseSetStatement(DdlTokenStream tokens,
AstNode parentNode)
Parses DDL SET AstNode based on SQL 92 specifications. |
protected AstNode |
parseSlashedStatement(DdlTokenStream tokens,
String[] stmt_start_phrase,
AstNode parentNode,
Name mixinType)
Utility method to parse a generic statement given a start phrase and statement mixin type. |
protected void |
rewrite(DdlTokenStream tokens,
AstNode rootNode)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OracleDdlParser()
Method Detail |
---|
public String getId()
getId
in interface DdlParser
getId
in class StandardDdlParser
StandardDdlParser.getId()
public String[] getIdentifyingKeywords()
getIdentifyingKeywords
in class StandardDdlParser
StandardDdlParser.getIdentifyingKeywords()
protected void initializeTokenStream(DdlTokenStream tokens)
StandardDdlParser.score(String, String, DdlParserScorer)
and StandardDdlParser.parse(String, AstNode, Object)
to initialize
the token stream
, giving subclasses a chance to register
key words
and statement start phrases
.
initializeTokenStream
in class StandardDdlParser
tokens
- the stream of tokensStandardDdlParser.initializeTokenStream(org.modeshape.sequencer.ddl.DdlTokenStream)
protected void rewrite(DdlTokenStream tokens, AstNode rootNode)
rewrite
in class StandardDdlParser
public AstNode handleUnknownToken(DdlTokenStream tokens, String tokenValue) throws ParsingException
handleUnknownToken
in class StandardDdlParser
tokens
- the DdlTokenStream
representing the tokenized DDL content; may not be nulltokenValue
- the string value of the unknown token; never null
ParsingException
StandardDdlParser.handleUnknownToken(org.modeshape.sequencer.ddl.DdlTokenStream,
java.lang.String)
protected AstNode parseCreateSchemaStatement(DdlTokenStream tokens, AstNode parentNode) throws ParsingException
AstNode
based on SQL 92 specifications. Initial implementation here does not parse the
statement in detail. The CREATE SCHEMA statement can include CREATE TABLE, CREATE VIEW, and GRANT statements.
parseCreateSchemaStatement
in class StandardDdlParser
tokens
- the DdlTokenStream
representing the tokenized DDL content; may not be nullparentNode
- the parent AstNode
node; may not be null
ParsingException
StandardDdlParser.parseCreateSchemaStatement(org.modeshape.sequencer.ddl.DdlTokenStream,
org.modeshape.sequencer.ddl.node.AstNode)
protected AstNode parseCustomStatement(DdlTokenStream tokens, AstNode parentNode) throws ParsingException
parseCustomStatement
in class StandardDdlParser
tokens
- the DdlTokenStream
representing the tokenized DDL content; may not be nullparentNode
- the parent AstNode
node; may not be null
AstNode
ParsingException
StandardDdlParser.parseCustomStatement(org.modeshape.sequencer.ddl.DdlTokenStream,
org.modeshape.sequencer.ddl.node.AstNode)
protected AstNode parseCreateStatement(DdlTokenStream tokens, AstNode parentNode) throws ParsingException
StandardDdlParser
parseCreateStatement
in class StandardDdlParser
tokens
- the DdlTokenStream
representing the tokenized DDL content; may not be nullparentNode
- the parent AstNode
node; may not be null
AstNode
ParsingException
protected AstNode parseCreateFunctionStatement(DdlTokenStream tokens, AstNode parentNode) throws ParsingException
tokens
- the tokenized DdlTokenStream
of the DDL input content; may not be nullparentNode
- the parent AstNode
node; may not be null
ParsingException
protected AstNode parseCreateProcedureStatement(DdlTokenStream tokens, AstNode parentNode) throws ParsingException
tokens
- the tokenized DdlTokenStream
of the DDL input content; may not be nullparentNode
- the parent AstNode
node; may not be null
ParsingException
protected AstNode parseMaterializedViewStatement(DdlTokenStream tokens, AstNode parentNode) throws ParsingException
tokens
- the tokenized DdlTokenStream
of the DDL input content; may not be nullparentNode
- the parent AstNode
node; may not be null
ParsingException
protected AstNode parseGrantStatement(DdlTokenStream tokens, AstNode parentNode) throws ParsingException
StandardDdlParser
AstNode
based on SQL 92 specifications.
parseGrantStatement
in class StandardDdlParser
tokens
- the DdlTokenStream
representing the tokenized DDL content; may not be nullparentNode
- the parent AstNode
node; may not be null
AstNode
ParsingException
protected AstNode parseRevokeStatement(DdlTokenStream tokens, AstNode parentNode) throws ParsingException
parseRevokeStatement
in class StandardDdlParser
ParsingException
StandardDdlParser.parseRevokeStatement(org.modeshape.sequencer.ddl.DdlTokenStream,
org.modeshape.sequencer.ddl.node.AstNode)
protected AstNode parseAlterTableStatement(DdlTokenStream tokens, AstNode parentNode) throws ParsingException
StandardDdlParser
AstNode
based on SQL 92 specifications.
parseAlterTableStatement
in class StandardDdlParser
tokens
- the DdlTokenStream
representing the tokenized DDL content; may not be nullparentNode
- the parent AstNode
node; may not be null
AstNode
ParsingException
protected AstNode parseAlterStatement(DdlTokenStream tokens, AstNode parentNode) throws ParsingException
StandardDdlParser
parseAlterStatement
in class StandardDdlParser
tokens
- the DdlTokenStream
representing the tokenized DDL content; may not be nullparentNode
- the parent AstNode
node; may not be null
AstNode
ParsingException
protected AstNode parseCreateViewStatement(DdlTokenStream tokens, AstNode parentNode) throws ParsingException
AstNode
basedregisterStatementStartPhrase on SQL 92 specifications. Initial implementation
here does not parse the statement in detail.
parseCreateViewStatement
in class StandardDdlParser
tokens
- the DdlTokenStream
representing the tokenized DDL content; may not be nullparentNode
- the parent AstNode
node; may not be null
ParsingException
StandardDdlParser.parseCreateViewStatement(org.modeshape.sequencer.ddl.DdlTokenStream,
org.modeshape.sequencer.ddl.node.AstNode)
protected AstNode parseSetStatement(DdlTokenStream tokens, AstNode parentNode) throws ParsingException
StandardDdlParser
AstNode
based on SQL 92 specifications.
parseSetStatement
in class StandardDdlParser
tokens
- the DdlTokenStream
representing the tokenized DDL content; may not be nullparentNode
- the parent AstNode
node; may not be null
AstNode
ParsingException
protected AstNode parseDropStatement(DdlTokenStream tokens, AstNode parentNode) throws ParsingException
StandardDdlParser
AstNode
based on SQL 92 specifications.
parseDropStatement
in class StandardDdlParser
tokens
- the DdlTokenStream
representing the tokenized DDL content; may not be nullparentNode
- the parent AstNode
node; may not be null
AstNode
ParsingException
protected void parseColumns(DdlTokenStream tokens, AstNode tableNode, boolean isAlterTable) throws ParsingException
tokens
- the tokenized DdlTokenStream
of the DDL input content; may not be nulltableNode
- isAlterTable
-
ParsingException
protected AstNode parseSlashedStatement(DdlTokenStream tokens, String[] stmt_start_phrase, AstNode parentNode, Name mixinType)
tokens
- the tokenized DdlTokenStream
of the DDL input content; may not be nullstmt_start_phrase
- the string array statement start phraseparentNode
- the parent AstNode
node; may not be nullmixinType
- the mixin type of the newly created statement node
protected Name[] getValidSchemaChildTypes()
getValidSchemaChildTypes
in class StandardDdlParser
StandardDdlParser.getValidSchemaChildTypes()
protected List<String> getCustomDataTypeStartWords()
getCustomDataTypeStartWords
in class StandardDdlParser
StandardDdlParser.getDataTypeStartWords()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |