org.dbmaintain.script.parser.parsingstate.impl
Class InSingleQuotesParsingState

java.lang.Object
  extended by org.dbmaintain.script.parser.parsingstate.impl.InSingleQuotesParsingState
All Implemented Interfaces:
ParsingState

public class InSingleQuotesParsingState
extends Object
implements ParsingState

A state for parsing single quotes ('text') part of a script.

Author:
Tim Ducheyne, Filip Neven

Field Summary
protected  boolean backSlashEscapingEnabled
           
protected  HandleNextCharacterResult backToNormalResult
           
protected  boolean escaping
           
protected  HandleNextCharacterResult stayInSingleQuotesStateResult
           
 
Constructor Summary
InSingleQuotesParsingState(boolean backSlashEscapingEnabled)
           
 
Method Summary
 HandleNextCharacterResult getNextParsingState(Character previousChar, Character currentChar, Character nextChar, StatementBuilder statementBuilder)
          Determines whether the end of the literal is reached.
 void linkParsingStates(ParsingState normalParsingState)
          Initializes the state with the normal parsing state, that should be returned when the end of the literal is reached..
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

backSlashEscapingEnabled

protected boolean backSlashEscapingEnabled

escaping

protected boolean escaping

stayInSingleQuotesStateResult

protected HandleNextCharacterResult stayInSingleQuotesStateResult

backToNormalResult

protected HandleNextCharacterResult backToNormalResult
Constructor Detail

InSingleQuotesParsingState

public InSingleQuotesParsingState(boolean backSlashEscapingEnabled)
Parameters:
backSlashEscapingEnabled - True if backslashes can be used for escaping
Method Detail

linkParsingStates

public void linkParsingStates(ParsingState normalParsingState)
Initializes the state with the normal parsing state, that should be returned when the end of the literal is reached..

Parameters:
normalParsingState - The normal state, not null

getNextParsingState

public HandleNextCharacterResult getNextParsingState(Character previousChar,
                                                     Character currentChar,
                                                     Character nextChar,
                                                     StatementBuilder statementBuilder)
Determines whether the end of the literal is reached. If that is the case, the normal parsing state is returned.

Specified by:
getNextParsingState in interface ParsingState
Parameters:
previousChar - The previous char, null if none
currentChar - The current char
nextChar - The next char, null if none
statementBuilder - The statement builder, not null
Returns:
The next parsing state, null if the end of the statement is reached


Copyright © 2011. All Rights Reserved.