|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.dbmaintainer.script.parsingstate.impl.BaseParsingState
org.unitils.dbmaintainer.script.parsingstate.impl.NormalParsingState
org.unitils.dbmaintainer.script.parsingstate.impl.OracleNormalParsingState
public class OracleNormalParsingState
The initial state for Oracle. This parser adds PL/SQL statement recognition to the parser. In order for the parser to recognize the ending of a code block, the SQLPlus standard must be followed, namely every code block should end with line containing a single forward slash (/).
| Field Summary | |
|---|---|
protected StringBuilder |
lineBuffer
Contains the current line |
protected boolean |
parsingCodeBlock
True if a code block is being parsed |
protected StringBuilder |
statementBuffer
Contains the current statement letters (no signs..) with all double whitespace and newlines converted to single whitespace |
| Fields inherited from class org.unitils.dbmaintainer.script.parsingstate.impl.NormalParsingState |
|---|
backSlashEscapingEnabled, escaping, inBlockCommentParsingState, inDoubleQuotesParsingState, inLineCommentParsingState, inSingleQuotesParsingState |
| Constructor Summary | |
|---|---|
OracleNormalParsingState()
|
|
| Method Summary | |
|---|---|
protected ParsingState |
getNextParsingState(char previousChar,
char currentChar,
char nextChar,
StatementBuilder statementBuilder)
Overridden to also correctly identify the starting of PL/SQL code blocks and to handle slashes / to end a statement. |
protected boolean |
isStartOfCodeStatement(StringBuilder statement)
Checks whether the statment contains the starting letters of a code statement (eg CREATE PACKAGE). |
protected boolean |
matches(String text,
StringBuilder statement)
Utility method to check whether the given statement starts with the letters of the given text. |
| Methods inherited from class org.unitils.dbmaintainer.script.parsingstate.impl.NormalParsingState |
|---|
init |
| Methods inherited from class org.unitils.dbmaintainer.script.parsingstate.impl.BaseParsingState |
|---|
handleNextChar |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean parsingCodeBlock
protected StringBuilder lineBuffer
protected StringBuilder statementBuffer
| Constructor Detail |
|---|
public OracleNormalParsingState()
| Method Detail |
|---|
protected ParsingState getNextParsingState(char previousChar,
char currentChar,
char nextChar,
StatementBuilder statementBuilder)
getNextParsingState in class NormalParsingStatepreviousChar - The previous char, 0 if nonecurrentChar - The current charnextChar - The next char, 0 if nonestatementBuilder - The statement builder, not null
protected boolean isStartOfCodeStatement(StringBuilder statement)
statement - The buffer, not null
protected boolean matches(String text,
StringBuilder statement)
text - The starting letters, not nullstatement - The statement to check
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||