public final class PackageDescriptionFileParser extends AbstractFileParser
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Integer |
formatVersion
The formatVersion of the package description file.
|
private static java.lang.String |
LINE
line.
|
private java.util.List<PackageRule> |
packageRules
is the List of PackageRules of the Parser.
|
private RouterSoftware |
rs
The associated RouterSoftware.
|
| Modifier | Constructor and Description |
|---|---|
private |
PackageDescriptionFileParser(RouterSoftware rs,
Buffer<AbstractSymbol> symbolBuffer)
constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPackageRule(PackageRule packageRule)
adds a new Packagerule to the List of the PackageRules.
|
private void |
handleWeakVariable()
Uses the next two symbols of the buffer to add a weak declaration.
|
private PackageDescriptionFile |
parse()
parses the symbols from the scanner and create a PackageDescriptionFile.
|
static PackageDescriptionFile |
parse(RouterSoftware rs,
Buffer<AbstractSymbol> buffer)
creates a PackageDescriptionFileParser and starts the parse-Method.
|
PackageDescriptionFileSymbol |
peekSymbol() |
void |
setFormatVersion(java.lang.Integer version)
sets the format version.
|
void |
skip()
removes the first symbol of the buffer.
|
getBuffer, getComments, isFinished, setComments, setFinishedprivate final RouterSoftware rs
private static final java.lang.String LINE
private final transient java.util.List<PackageRule> packageRules
private transient java.lang.Integer formatVersion
private PackageDescriptionFileParser(RouterSoftware rs, Buffer<AbstractSymbol> symbolBuffer)
rs - The RouterSoftware to use.symbolBuffer - Buffer of Symbols.public static PackageDescriptionFile parse(RouterSoftware rs, Buffer<AbstractSymbol> buffer) throws java.lang.InterruptedException, ParserException
rs - The RouterSoftware to use.buffer - is the buffer with the symbols.java.lang.InterruptedException - if there is any problem with the buffer.ParserException - if there is any problem during the parse-methode.private PackageDescriptionFile parse() throws java.lang.InterruptedException, ParserException
ParserException - if there is any fail in the parser.java.lang.InterruptedException - from the buffer.private void handleWeakVariable()
throws java.lang.InterruptedException,
ParserException
java.lang.InterruptedException - InterruptedExceptionParserException - ParserExceptionpublic void addPackageRule(PackageRule packageRule)
packageRule - new onepublic void setFormatVersion(java.lang.Integer version)
version - is the format version of the package description.public void skip()
throws java.lang.InterruptedException
java.lang.InterruptedException - from the buffer.public PackageDescriptionFileSymbol peekSymbol() throws java.lang.InterruptedException, ParserException
java.lang.InterruptedException - from the buffer.ParserException - if the next Symbol is no package description file symbol.