|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.springsource.util.parser.manifest.RecoveringManifestParser
public class RecoveringManifestParser
Builds upon the ManifestLexer that breaks a bunch of text data into a series of tokens
Concurrent Semantics
This class is thread safe.
Field Summary | |
---|---|
private static java.lang.String |
NAME_HEADER
|
(package private) TokenStream |
tokenStream
|
(package private) ManifestVisitor |
visitor
|
Constructor Summary | |
---|---|
RecoveringManifestParser()
|
|
RecoveringManifestParser(ManifestVisitor visitor)
|
Method Summary | |
---|---|
private void |
checkForRogueNewlinesProceedingInput()
|
private void |
confirmEnd()
|
void |
eatAttribute(boolean isMain)
|
void |
eatColon()
|
boolean |
eatNameAttribute()
Expects to eat "Name" ":" " |
void |
eatNewline()
|
boolean |
eatSection(boolean isMain)
Eat a section from the input data. |
void |
eatVersionInfo()
|
void |
eatVersionNumber()
|
boolean |
foundProblems()
|
ManifestContents |
getManifestContents()
|
java.util.List<ManifestProblem> |
getProblems()
|
private boolean |
maybeEatHeaderName(java.lang.String expectedName)
Consume a specific Name token from the token stream, report an error if it is the wrong kind or the wrong name. |
private boolean |
maybeEatNewline()
|
ManifestContents |
parse(java.io.Reader reader)
Parse a manifest from the supplied reader. |
ManifestContents |
parse(java.lang.String manifestString)
Parse an input string of data as a manifest. |
(package private) ManifestContents |
parseManifest()
|
private void |
recordProblem(ManifestProblemKind parseProblem,
int startOffset,
int endOffset,
java.lang.String... inserts)
Record a problem with parsing. |
void |
setTerminateAfterMainSection(boolean shouldTerminate)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String NAME_HEADER
ManifestVisitor visitor
TokenStream tokenStream
Constructor Detail |
---|
public RecoveringManifestParser()
public RecoveringManifestParser(ManifestVisitor visitor)
Method Detail |
---|
public ManifestContents parse(java.lang.String manifestString)
ManifestParser
parse
in interface ManifestParser
public ManifestContents parse(java.io.Reader reader) throws java.io.IOException
ManifestParser
parse
in interface ManifestParser
java.io.IOException
- if there is a problem with the ReaderManifestContents parseManifest()
public ManifestContents getManifestContents()
private void confirmEnd()
private void checkForRogueNewlinesProceedingInput()
public void eatNewline()
public boolean eatSection(boolean isMain)
isMain
- is this expected to be the main section?
public void eatVersionInfo()
private boolean maybeEatHeaderName(java.lang.String expectedName)
expectedName
-
public void eatColon()
public void eatAttribute(boolean isMain)
public void eatVersionNumber()
private boolean maybeEatNewline()
public boolean eatNameAttribute()
public boolean foundProblems()
foundProblems
in interface ManifestParser
public java.util.List<ManifestProblem> getProblems()
getProblems
in interface ManifestParser
private void recordProblem(ManifestProblemKind parseProblem, int startOffset, int endOffset, java.lang.String... inserts)
parseProblem
- the kind of problem that occurredstartOffset
- the start offset of the problemendOffset
- the end offset of the probleminserts
- the inserts for the problem message textpublic void setTerminateAfterMainSection(boolean shouldTerminate)
setTerminateAfterMainSection
in interface ManifestParser
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |