org.unitils.dbmaintainer.script.parsingstate.impl
Class BaseParsingState
java.lang.Object
org.unitils.dbmaintainer.script.parsingstate.impl.BaseParsingState
- All Implemented Interfaces:
- ParsingState
- Direct Known Subclasses:
- InBlockCommentParsingState, InDoubleQuotesParsingState, InLineCommentParsingState, InSingleQuotesParsingState, NormalParsingState
public abstract class BaseParsingState
- extends Object
- implements ParsingState
Base class for a parsing state. This will handle a character by simply adding it to the statement builder.
- Author:
- Tim Ducheyne, Filip Neven
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BaseParsingState
public BaseParsingState()
handleNextChar
public ParsingState handleNextChar(char previousChar,
char currentChar,
char nextChar,
StatementBuilder statementBuilder)
- Handles the next character by adding it to the statement builder.
- Specified by:
handleNextChar
in interface ParsingState
- Parameters:
previousChar
- The previous char, 0 if nonecurrentChar
- The current charnextChar
- The next char, 0 if nonestatementBuilder
- The statement builder, not null
- Returns:
- The next parsing state, null if the end of the statement is reached
getNextParsingState
protected abstract ParsingState getNextParsingState(char previousChar,
char currentChar,
char nextChar,
StatementBuilder statementBuilder)
- Determines the next state.
- Parameters:
previousChar
- The previous char, 0 if nonecurrentChar
- The current charnextChar
- The next char, 0 if nonestatementBuilder
- The statement builder, not null
- Returns:
- The next parsing state, null if the end of the statement is reached
Copyright © 2011. All Rights Reserved.