public final class VersionParser extends Object implements VersionParserConstants
Version ::= Token ( ( <SEPARATOR> )* Token )* <EOF> Token ::= <INTEGER> | <IDENTIFIER>
A separator character is defined as
An integer is a sequence of digits. An identifier is everything else, not a separator character or an integer.[".","_","-","@","/","\\"," ","\t","\n","\r","\f","\b","\"","\'"]
compare(String, String)
Modifier and Type | Field and Description |
---|---|
Token |
jj_nt
Next token.
|
Token |
token
Current token.
|
VersionParserTokenManager |
token_source
Generated Token Manager.
|
DEFAULT, EOF, IDENTIFIER, INTEGER, SEPARATOR, tokenImage
Constructor and Description |
---|
VersionParser(InputStream stream)
Constructor with InputStream.
|
VersionParser(InputStream stream,
String encoding)
Constructor with InputStream and supplied encoding
|
VersionParser(Reader stream)
Constructor.
|
VersionParser(VersionParserTokenManager tm)
Constructor with generated Token Manager.
|
Modifier and Type | Method and Description |
---|---|
static int |
compare(String v1,
String v2)
Compares two versions for order.
|
void |
disable_tracing()
Disable tracing.
|
void |
enable_tracing()
Enable tracing.
|
ParseException |
generateParseException()
Generate ParseException.
|
Token |
getNextToken()
Get the next Token.
|
Token |
getToken(int index)
Get the specific Token.
|
Token[] |
parse()
Parses the input to produce an array of tokens.
|
void |
ReInit(InputStream stream)
Reinitialise.
|
void |
ReInit(InputStream stream,
String encoding)
Reinitialise.
|
void |
ReInit(Reader stream)
Reinitialise.
|
void |
ReInit(VersionParserTokenManager tm)
Reinitialise.
|
public VersionParserTokenManager token_source
public VersionParser(InputStream stream)
public VersionParser(InputStream stream, String encoding)
public VersionParser(Reader stream)
public VersionParser(VersionParserTokenManager tm)
public static int compare(String v1, String v2) throws ParseException
This method parses the given strings to produce a sequence of tokens and then compares these tokens for order.
v1
- the version to compare with.v2
- the version to compare to.NullPointerException
- if v1
or v2
is null
.ParseException
- if parsing fails.public final void disable_tracing()
public final void enable_tracing()
public ParseException generateParseException()
public final Token getNextToken()
public Token[] parse() throws ParseException
ParseException
- if the parse fails.public void ReInit(InputStream stream)
public void ReInit(InputStream stream, String encoding)
public void ReInit(VersionParserTokenManager tm)
Copyright © 2005-2012 jDTAUS. All Rights Reserved.