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

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

public class InLineCommentParsingState
extends BaseParsingState

A state for parsing an in-line comment (-- comment) part of a script.

Author:
Tim Ducheyne, Filip Neven

Field Summary
protected  ParsingState normalParsingState
          The normal parsing state, that should be returned when the comment end is reached.
 
Constructor Summary
InLineCommentParsingState()
           
 
Method Summary
protected  ParsingState getNextParsingState(char previousChar, char currentChar, char nextChar, StatementBuilder statementBuilder)
          Determines whether the end of the line comment is reached.
 void init(ParsingState normalParsingState)
          Initializes the state with the normal parsing state, that should be returned when the comment end 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 comment end is reached.

Constructor Detail

InLineCommentParsingState

public InLineCommentParsingState()
Method Detail

init

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

Parameters:
normalParsingState - The normal state, not null

getNextParsingState

protected ParsingState getNextParsingState(char previousChar,
                                           char currentChar,
                                           char nextChar,
                                           StatementBuilder statementBuilder)
Determines whether the end of the line comment 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.