|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dbmaintain.script.parser.impl.DefaultScriptParser
public class DefaultScriptParser
A class for parsing statements out of sql scripts.
All statements should be separated with a semicolon (;). The last statement will be added even if it does not end with a semicolon. The semicolons will not be included in the returned statements. This parser also takes quoted literals, double quoted text and in-line (--comment) and block (/ * comment * /) into account when parsing the statements.
| Field Summary | |
|---|---|
protected boolean |
backSlashEscapingEnabled
Whether backslash escaping is enabled |
protected Character |
currentChar
The current parsed character |
protected boolean |
endOfScriptReached
True if the script has ended |
protected ParsingState |
initialParsingState
The starting state |
protected Character |
nextChar
The current parsed character |
protected Properties |
scriptParameters
Parameters that must be replaced in the script. |
protected Reader |
scriptReader
The reader for the script content stream |
| Constructor Summary | |
|---|---|
DefaultScriptParser(Reader scriptReader,
ParsingState initialParsingState,
boolean backSlashEscapingEnabled,
Properties scriptParameters)
Constructor for DefaultScriptParser. |
|
| Method Summary | |
|---|---|
protected StatementBuilder |
createStatementBuilder()
Factory method for the statement builder. |
String |
getNextStatement()
Parses the next statement out of the given script stream. |
protected String |
getNextStatementImpl()
Actual implementation of getNextStatement. |
protected Character |
readNextCharacter()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Reader scriptReader
protected boolean backSlashEscapingEnabled
protected Properties scriptParameters
protected ParsingState initialParsingState
protected boolean endOfScriptReached
protected Character currentChar
protected Character nextChar
| Constructor Detail |
|---|
public DefaultScriptParser(Reader scriptReader,
ParsingState initialParsingState,
boolean backSlashEscapingEnabled,
Properties scriptParameters)
scriptReader - the reader that will provide the script content, not nullinitialParsingState - the inial state when starting to parse a script, not nullbackSlashEscapingEnabled - true if backslash escaping is enabledscriptParameters - parameters that must be replaced in the script. null if there are no such parameters.| Method Detail |
|---|
public String getNextStatement()
getNextStatement in interface ScriptParser
protected String getNextStatementImpl()
throws IOException
IOException - if a problem occurs reading the script from the file system
protected Character readNextCharacter()
throws IOException
IOExceptionprotected StatementBuilder createStatementBuilder()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||