public class DefaultScriptParser extends Object implements ScriptParser
| Modifier and Type | Field and Description |
|---|---|
protected int |
currentChar
The current parsed character
|
protected ParsingState |
currentParsingState
The current state.
|
protected ParsingState |
initialParsingState
The starting state.
|
static String |
PROPKEY_BACKSLASH_ESCAPING_ENABLED
Property indicating if the characters can be escaped by using backslashes.
|
protected Reader |
scriptReader
The reader for the script content stream.
|
| Constructor and Description |
|---|
DefaultScriptParser() |
| Modifier and Type | Method and Description |
|---|---|
protected InBlockCommentParsingState |
createInBlockCommentParsingState()
Factory method for the in-block comment (/ * comment * /) parsing state.
|
protected InDoubleQuotesParsingState |
createInDoubleQuotesParsingState()
Factory method for the double quotes ("text") literal parsing state.
|
protected ParsingState |
createInitialParsingState(boolean backSlashEscapingEnabled)
Builds the initial 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 NormalParsingState |
createNormalParsingState()
Factory method for the normal parsing state.
|
protected StatementBuilder |
createStatementBuilder()
Factory method for the statement builder.
|
String |
getNextStatement()
Parses the next statement out of the given script stream.
|
protected String |
getNextStatementImpl()
Actual implementation of getNextStatement.
|
void |
init(Properties configuration,
Reader scriptReader)
Initializes the parser with the given configuration settings.
|
public static final String PROPKEY_BACKSLASH_ESCAPING_ENABLED
protected ParsingState initialParsingState
protected ParsingState currentParsingState
protected int currentChar
protected Reader scriptReader
public void init(Properties configuration, Reader scriptReader)
init in interface ScriptParserconfiguration - The config, not nullscriptReader - the script stream, not nullpublic String getNextStatement()
getNextStatement in interface ScriptParserprotected String getNextStatementImpl() throws IOException
IOExceptionprotected ParsingState createInitialParsingState(boolean backSlashEscapingEnabled)
backSlashEscapingEnabled - True if a backslash can be used for escaping charactersprotected StatementBuilder createStatementBuilder()
protected NormalParsingState createNormalParsingState()
protected InLineCommentParsingState createInLineCommentParsingState()
protected InBlockCommentParsingState createInBlockCommentParsingState()
protected InSingleQuotesParsingState createInSingleQuotesParsingState()
protected InDoubleQuotesParsingState createInDoubleQuotesParsingState()
Copyright © 2017. All rights reserved.