public class AbstractParser extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractParser.NotAnIdentifierException |
Modifier and Type | Field and Description |
---|---|
static String |
BAD_ARGS_CLOSE_TAG |
static String |
BAD_JAVA_TYPE_SPECIFIER |
static String |
EOF_IN_JAVA_QUOTE_ERROR |
protected ParserErrorsImpl |
errors |
static String |
INCOMPLETE_ARRAY_SPECIFIER_ERROR |
static String |
MALFORMED_TAG_ERROR |
static String |
NOT_AN_IDENTIFIER_ERROR |
protected PositionalPushbackReader |
reader |
Constructor and Description |
---|
AbstractParser(PositionalPushbackReader reader,
ParserErrorsImpl errors) |
Modifier and Type | Method and Description |
---|---|
protected void |
addError(org.jamon.api.Location location,
String message) |
protected void |
addError(ParserErrorImpl error) |
protected boolean |
checkForTagClosure(org.jamon.api.Location tagLocation) |
protected boolean |
checkToken(String token) |
static String |
eofErrorMessage(String end) |
protected AbstractPathNode |
parsePath() |
protected boolean |
readAndAppendChar(char p_char,
StringBuilder builder)
Determine if the next character is a particular one, and if so, read and append it to a
StringBuilder.
|
protected boolean |
readChar(char chararacter)
Read a single character from the reader.
|
protected String |
readClassName(org.jamon.api.Location p_location) |
protected String |
readIdentifier(boolean addErrorIfNoneFound)
Read in a java identifier.
|
protected String |
readIdentifierOrThrow()
Reads in a java identifier.
|
protected String |
readJava(org.jamon.api.Location startLocation,
TagEndDetector tagEndDetector) |
protected String |
readType(org.jamon.api.Location location) |
protected String |
readUntil(String end,
org.jamon.api.Location startLocation)
Read from the reader until encountering an end marker
|
protected boolean |
soakWhitespace()
Soak up all whitespace from the reader until non-whitespace or EOF is encountered.
|
public static final String MALFORMED_TAG_ERROR
public static final String EOF_IN_JAVA_QUOTE_ERROR
public static final String NOT_AN_IDENTIFIER_ERROR
public static final String BAD_JAVA_TYPE_SPECIFIER
public static final String BAD_ARGS_CLOSE_TAG
public static final String INCOMPLETE_ARRAY_SPECIFIER_ERROR
protected final PositionalPushbackReader reader
protected final ParserErrorsImpl errors
public AbstractParser(PositionalPushbackReader reader, ParserErrorsImpl errors)
protected boolean soakWhitespace() throws IOException
IOException
protected void addError(org.jamon.api.Location location, String message)
protected void addError(ParserErrorImpl error)
protected String readIdentifierOrThrow() throws IOException, AbstractParser.NotAnIdentifierException
IOException
AbstractParser.NotAnIdentifierException
- if no identifier is foundprotected String readIdentifier(boolean addErrorIfNoneFound) throws IOException
addErrorIfNoneFound
- if true, and no identifier is found, then call
addError(ParserErrorImpl)
IOException
protected boolean readChar(char chararacter) throws IOException
chararacter
- The expected character.IOException
protected String readUntil(String end, org.jamon.api.Location startLocation) throws IOException
end
- The end marker for the stringstartLocation
- The location marking the start of the block being read - only used for
construcing error messages.IOException
protected String readJava(org.jamon.api.Location startLocation, TagEndDetector tagEndDetector) throws IOException, ParserErrorImpl
IOException
ParserErrorImpl
protected boolean checkForTagClosure(org.jamon.api.Location tagLocation) throws IOException
IOException
protected boolean checkToken(String token) throws IOException
token
- The token or token fragment we expect to seeIOException
protected String readType(org.jamon.api.Location location) throws IOException
IOException
protected String readClassName(org.jamon.api.Location p_location) throws IOException
IOException
protected AbstractPathNode parsePath() throws IOException
IOException
protected boolean readAndAppendChar(char p_char, StringBuilder builder) throws IOException
p_char
- The character being looked forbuilder
- The StringBuilderIOException
Copyright © 2003–2016 Jamon developers. All rights reserved.