public abstract class AbstractBodyParser<Node extends AbstractBodyNode> extends AbstractParser
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractBodyParser.JavaSnippetTagEndDetector |
AbstractParser.NotAnIdentifierException
Modifier and Type | Field and Description |
---|---|
static String |
ANNOTATE_TAG_IN_SUBCOMPONENT |
protected org.jamon.api.Location |
bodyStart |
static String |
CLASS_TAG_IN_SUBCOMPONENT |
static String |
EMIT_ESCAPE_CODE_ERROR |
static String |
EMIT_MISSING_TAG_END_ERROR |
static String |
ENCOUNTERED_ELSE_TAG_WITHOUT_PRIOR_IF_TAG |
static String |
ENCOUNTERED_ELSEIF_TAG_WITHOUT_PRIOR_IF_TAG |
static String |
ESCAPE_TAG_IN_SUBCOMPONENT |
static String |
EXTENDS_TAG_IN_SUBCOMPONENT |
static String |
GENERIC_TAG_IN_SUBCOMPONENT |
static String |
IMPLEMENTS_TAG_IN_SUBCOMPONENT |
static String |
PARENT_ARGS_TAG_IN_SUBCOMPONENT |
static String |
PARENT_MARKER_TAG_IN_SUBCOMPONENT |
static String |
PERCENT_GREATER_THAN_EOF_ERROR |
static String |
REPLACEABLE_TAG_IN_SUBCOMPONENT |
static String |
REPLACES_TAG_IN_SUBCOMPONENT |
protected Node |
root |
protected StringBuilder |
text |
static String |
UNEXPECTED_FRAGMENTS_CLOSE_ERROR |
static String |
UNEXPECTED_NAMED_FRAGMENT_CLOSE_ERROR |
BAD_ARGS_CLOSE_TAG, BAD_JAVA_TYPE_SPECIFIER, EOF_IN_JAVA_QUOTE_ERROR, errors, INCOMPLETE_ARRAY_SPECIFIER_ERROR, MALFORMED_TAG_ERROR, NOT_AN_IDENTIFIER_ERROR, reader
Modifier | Constructor and Description |
---|---|
protected |
AbstractBodyParser(Node rootNode,
PositionalPushbackReader reader,
ParserErrorsImpl errors) |
Modifier and Type | Method and Description |
---|---|
protected void |
doneParsing() |
Node |
getRootNode() |
protected void |
handleAbsMethodTag(org.jamon.api.Location tagLocation) |
protected void |
handleAliasesTag(org.jamon.api.Location tagLocation) |
protected void |
handleAnnotationTag(org.jamon.api.Location tagLocation) |
protected void |
handleClassTag(org.jamon.api.Location tagLocation) |
protected void |
handleDefTag(org.jamon.api.Location tagLocation) |
protected void |
handleElseIfTag(org.jamon.api.Location tagLocation) |
protected void |
handleElseTag(org.jamon.api.Location tagLocation) |
protected abstract void |
handleEof()
This method is called when an end of file is reached, and should add an error if this is not
acceptable
|
protected void |
handleEscapeTag(org.jamon.api.Location tagLocation) |
protected void |
handleExtendsTag(org.jamon.api.Location tagLocation) |
protected void |
handleForTag(org.jamon.api.Location tagLocation) |
protected boolean |
handleFragmentsClose(org.jamon.api.Location tagLocation)
Handle the occurence of a '</&>' tag
|
protected void |
handleGenericTag(org.jamon.api.Location tagLocation) |
protected void |
handleIfTag(org.jamon.api.Location tagLocation) |
protected void |
handleImplementsTag(org.jamon.api.Location tagLocation) |
protected void |
handleImportTag(org.jamon.api.Location tagLocation) |
protected void |
handleLiteralTag(org.jamon.api.Location tagLocation) |
protected void |
handleMethodTag(org.jamon.api.Location tagLocation) |
protected boolean |
handleNamedFragmentClose(org.jamon.api.Location tagLocation)
Handle the occurence of a '</|;>' tag
|
protected void |
handleOverrideTag(org.jamon.api.Location tagLocation) |
protected void |
handleParentArgsNode(org.jamon.api.Location tagLocation) |
protected void |
handleParentMarkerTag(org.jamon.api.Location tagLocation) |
protected void |
handleReplaceableTag(org.jamon.api.Location tagLocation) |
protected void |
handleReplacesTag(org.jamon.api.Location tagLocation) |
protected void |
handleTag(String tagName,
org.jamon.api.Location tagLocation) |
protected void |
handleTagClose(String tagName,
org.jamon.api.Location tagLocation)
Handle a tag closure
|
protected void |
handleText() |
protected void |
handleWhileTag(org.jamon.api.Location tagLocation) |
protected boolean |
isTopLevel() |
AbstractBodyParser<Node> |
parse() |
protected String |
readCondition(org.jamon.api.Location tagLocation,
String tagName) |
protected String |
readLine() |
protected String |
readTagName() |
addError, addError, checkForTagClosure, checkToken, eofErrorMessage, parsePath, readAndAppendChar, readChar, readClassName, readIdentifier, readIdentifierOrThrow, readJava, readType, readUntil, soakWhitespace
public static final String ENCOUNTERED_ELSE_TAG_WITHOUT_PRIOR_IF_TAG
public static final String ENCOUNTERED_ELSEIF_TAG_WITHOUT_PRIOR_IF_TAG
public static final String ESCAPE_TAG_IN_SUBCOMPONENT
public static final String GENERIC_TAG_IN_SUBCOMPONENT
public static final String ANNOTATE_TAG_IN_SUBCOMPONENT
public static final String CLASS_TAG_IN_SUBCOMPONENT
public static final String UNEXPECTED_NAMED_FRAGMENT_CLOSE_ERROR
public static final String UNEXPECTED_FRAGMENTS_CLOSE_ERROR
public static final String EMIT_ESCAPE_CODE_ERROR
public static final String EMIT_MISSING_TAG_END_ERROR
public static final String PERCENT_GREATER_THAN_EOF_ERROR
public static final String EXTENDS_TAG_IN_SUBCOMPONENT
public static final String IMPLEMENTS_TAG_IN_SUBCOMPONENT
public static final String REPLACES_TAG_IN_SUBCOMPONENT
public static final String REPLACEABLE_TAG_IN_SUBCOMPONENT
public static final String PARENT_ARGS_TAG_IN_SUBCOMPONENT
public static final String PARENT_MARKER_TAG_IN_SUBCOMPONENT
protected StringBuilder text
protected final Node extends AbstractBodyNode root
protected final org.jamon.api.Location bodyStart
protected AbstractBodyParser(Node rootNode, PositionalPushbackReader reader, ParserErrorsImpl errors)
protected void handleText()
public AbstractBodyParser<Node> parse() throws IOException
IOException
protected void doneParsing()
protected boolean isTopLevel()
true
if this is a top level parserprotected void handleTag(String tagName, org.jamon.api.Location tagLocation) throws IOException
IOException
protected void handleTagClose(String tagName, org.jamon.api.Location tagLocation) throws IOException
tagName
- The tag nametagLocation
- The tag locationIOException
protected abstract void handleEof()
protected boolean handleNamedFragmentClose(org.jamon.api.Location tagLocation) throws IOException
true
if this parser is doneIOException
protected boolean handleFragmentsClose(org.jamon.api.Location tagLocation) throws IOException
true
if this parser is doneIOException
protected void handleMethodTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the def
tagIOException
protected void handleOverrideTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the def tagIOException
protected void handleDefTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the def tagIOException
protected void handleAbsMethodTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the absmeth tagIOException
protected void handleWhileTag(org.jamon.api.Location tagLocation) throws IOException
IOException
protected void handleForTag(org.jamon.api.Location tagLocation) throws IOException
IOException
protected void handleIfTag(org.jamon.api.Location tagLocation) throws IOException
IOException
protected String readCondition(org.jamon.api.Location tagLocation, String tagName) throws IOException, ParserErrorImpl
IOException
ParserErrorImpl
protected void handleElseTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the else tagIOException
protected void handleElseIfTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the elseif
tagIOException
protected void handleParentArgsNode(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the xargs
nodeIOException
protected void handleParentMarkerTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the abstract
tagIOException
protected void handleEscapeTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the escape
tagIOException
protected void handleGenericTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the generic
tagIOException
protected void handleAnnotationTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the annotate
tagIOException
protected void handleLiteralTag(org.jamon.api.Location tagLocation) throws IOException
IOException
protected void handleClassTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the class
tag.IOException
protected void handleExtendsTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the extends
tagIOException
protected void handleImplementsTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the implements
tagIOException
protected void handleReplacesTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the replaces
tagIOException
protected void handleReplaceableTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the replaceable
tagIOException
protected void handleImportTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the import
tagIOException
protected void handleAliasesTag(org.jamon.api.Location tagLocation) throws IOException
tagLocation
- location of the alias
tagIOException
protected String readTagName() throws IOException
IOException
protected String readLine() throws IOException
IOException
public Node getRootNode()
Copyright © 2003–2018 Jamon developers. All rights reserved.