org.dbmaintain.script.parser.impl
Class DefaultScriptParserFactory

java.lang.Object
  extended by org.dbmaintain.script.parser.impl.DefaultScriptParserFactory
All Implemented Interfaces:
ScriptParserFactory
Direct Known Subclasses:
Db2ScriptParserFactory, InformixScriptParserFactory, MySqlScriptParserFactory, OracleScriptParserFactory, PostgreSqlScriptParserFactory

public class DefaultScriptParserFactory
extends Object
implements ScriptParserFactory

Author:
Filip Neven, Tim Ducheyne

Field Summary
protected  boolean backSlashEscapingEnabled
           
protected  Properties scriptParameters
           
 
Constructor Summary
DefaultScriptParserFactory(boolean backSlashEscapingEnabled, Properties scriptParameters)
           
 
Method Summary
protected  EscapingParsingState createEscapingParsingState()
           
protected  InBlockCommentParsingState createInBlockCommentParsingState()
          Factory method for the in-block comment (/ * comment * /) parsing state.
protected  InCurlyBraceBlockCommentParsingState createInCurlyBraceBlockCommentParsingState()
          Factory method for the in-block comment ({ comment }) parsing state.
protected  InDoubleQuotesParsingState createInDoubleQuotesParsingState()
          Factory method for the double quotes ("text") literal parsing state.
protected  InLineCommentParsingState createInLineCommentParsingState()
          Factory method for the in-line comment (-- comment) parsing state.
protected  InSingleQuotesParsingState createInSingleQuotesParsingState()
          Factory method for the single quotes ('text') parsing state.
protected  SqlStatementNormalParsingState createNormalParsingStates()
          Creates all the parsing states needed by a script parser when in normal (not stored procedure) state and connects them together.
 ScriptParser createScriptParser(Reader scriptReader)
           
protected  SqlStatementNormalParsingState createSqlStatementNormalParsingState()
          Factory method for the normal sql statement parsing state.
protected  PlSqlBlockMatcher createStoredProcedureMatcher()
          Factory method that returns the correct implementation of PlSqlBlockMatcher
protected  PlSqlBlockNormalParsingState createStoredProcedureNormalParsingState()
          Factory method for the normal stored procedure parsing state.
protected  PlSqlBlockNormalParsingState createStoredProcedureParsingStates()
          Creates all the parsing states needed by a script parser when in stored procedure state and connects them together.
protected  boolean isCurlyBraceBlockCommentSupported()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

backSlashEscapingEnabled

protected boolean backSlashEscapingEnabled

scriptParameters

protected Properties scriptParameters
Constructor Detail

DefaultScriptParserFactory

public DefaultScriptParserFactory(boolean backSlashEscapingEnabled,
                                  Properties scriptParameters)
Method Detail

createScriptParser

public ScriptParser createScriptParser(Reader scriptReader)
Specified by:
createScriptParser in interface ScriptParserFactory

createNormalParsingStates

protected SqlStatementNormalParsingState createNormalParsingStates()
Creates all the parsing states needed by a script parser when in normal (not stored procedure) state and connects them together. Returns the initial parsing state. All other parsing states can be reached starting from the initial state.

Returns:
the initial parsing state

createStoredProcedureParsingStates

protected PlSqlBlockNormalParsingState createStoredProcedureParsingStates()
Creates all the parsing states needed by a script parser when in stored procedure state and connects them together. Returns the initial parsing state. All other parsing states can be reached starting from the initial state.

Returns:
the initial parsing state

createSqlStatementNormalParsingState

protected SqlStatementNormalParsingState createSqlStatementNormalParsingState()
Factory method for the normal sql statement parsing state.

Returns:
The normal sql statement state, not null

createStoredProcedureNormalParsingState

protected PlSqlBlockNormalParsingState createStoredProcedureNormalParsingState()
Factory method for the normal stored procedure parsing state.

Returns:
The normal stored procedure state, not null

createInLineCommentParsingState

protected InLineCommentParsingState createInLineCommentParsingState()
Factory method for the in-line comment (-- comment) parsing state.

Returns:
The normal state, not null

createInBlockCommentParsingState

protected InBlockCommentParsingState createInBlockCommentParsingState()
Factory method for the in-block comment (/ * comment * /) parsing state.

Returns:
The normal state, not null

createInCurlyBraceBlockCommentParsingState

protected InCurlyBraceBlockCommentParsingState createInCurlyBraceBlockCommentParsingState()
Factory method for the in-block comment ({ comment }) parsing state.

Returns:
The normal state, not null

createInSingleQuotesParsingState

protected InSingleQuotesParsingState createInSingleQuotesParsingState()
Factory method for the single quotes ('text') parsing state.

Returns:
The normal state, not null

createInDoubleQuotesParsingState

protected InDoubleQuotesParsingState createInDoubleQuotesParsingState()
Factory method for the double quotes ("text") literal parsing state.

Returns:
The normal state, not null

createEscapingParsingState

protected EscapingParsingState createEscapingParsingState()

createStoredProcedureMatcher

protected PlSqlBlockMatcher createStoredProcedureMatcher()
Factory method that returns the correct implementation of PlSqlBlockMatcher

Returns:
the stored procedure matcher, not null

isCurlyBraceBlockCommentSupported

protected boolean isCurlyBraceBlockCommentSupported()
Returns:
whether informix-style block comments using curly braces {} are supported


Copyright © 2011. All Rights Reserved.