org.unitils.dbmaintainer.script.parsingstate.impl
Class InDoubleQuotesParsingState

java.lang.Object
  extended by org.unitils.dbmaintainer.script.parsingstate.impl.BaseParsingState
      extended by org.unitils.dbmaintainer.script.parsingstate.impl.InDoubleQuotesParsingState
All Implemented Interfaces:
ParsingState

public class InDoubleQuotesParsingState
extends BaseParsingState

A state for parsing double quotes ("text") literal part of a script.

Author:
Tim Ducheyne, Filip Neven

Field Summary
protected  boolean backSlashEscapingEnabled
          Determines whether backslashes can be used to escape characters, e.g. \" for a double quote (= "")
protected  boolean escaping
          True if the next character should be escaped
protected  ParsingState normalParsingState
          The normal parsing state, that should be returned when the quote end is reached.
 
Constructor Summary
InDoubleQuotesParsingState()
           
 
Method Summary
protected  ParsingState getNextParsingState(char previousChar, char currentChar, char nextChar, StatementBuilder statementBuilder)
          Determines whether the end of the literal is reached.
 void init(ParsingState normalParsingState, boolean backSlashEscapingEnabled)
          Initializes the state with the normal parsing state, that should be returned when the end of the literal is reached.
 
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

normalParsingState

protected ParsingState normalParsingState
The normal parsing state, that should be returned when the quote end is reached.


backSlashEscapingEnabled

protected boolean backSlashEscapingEnabled
Determines whether backslashes can be used to escape characters, e.g. \" for a double quote (= "")


escaping

protected boolean escaping
True if the next character should be escaped

Constructor Detail

InDoubleQuotesParsingState

public InDoubleQuotesParsingState()
Method Detail

init

public void init(ParsingState normalParsingState,
                 boolean backSlashEscapingEnabled)
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
backSlashEscapingEnabled - True if backslashes can be used for escaping

getNextParsingState

protected ParsingState getNextParsingState(char previousChar,
                                           char currentChar,
                                           char 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 class BaseParsingState
Parameters:
previousChar - The previous char, 0 if none
currentChar - The current char
nextChar - The next char, 0 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.