Package org.datanucleus.plugin
Class PluginParser.Parser
- java.lang.Object
-
- org.datanucleus.plugin.PluginParser.Parser
-
- Enclosing class:
- PluginParser
public static class PluginParser.Parser extends java.lang.Object
Parser for a list of Bundle-Description
-
-
Constructor Summary
Constructors Constructor Description Parser(java.lang.String input)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getIndex()
Accessor for the current index in the input string.java.lang.String
getInput()
Accessor for the input string.private boolean
isDecDigit(char c)
Utility to return if a character is a decimal digit.private boolean
isHexDigit(char c)
Utility to return if a character is a hexadecimal digit.private boolean
isOctDigit(char c)
Utility to return if a character is a octal digit.boolean
nextIsComma()
Utility to return if the next character is a comma.boolean
nextIsDot()
Utility to return if the next character is a dot.boolean
nextIsSemiColon()
Utility to return if the next character is a semi-colon.boolean
nextIsSingleQuote()
Utility to return if the next non-whitespace character is a single quote.boolean
parseChar(char c)
Check if charc
is foundboolean
parseChar(char c, char unlessFollowedBy)
Check if charc
is foundboolean
parseEOS()
Check if END OF TEXT is reachprivate char
parseEscapedCharacter()
Parse a escaped characterjava.lang.String
parseIdentifier()
Parse a java identifier from the current position.java.math.BigInteger
parseIntegerLiteral()
Parse an integer number from the current position.java.lang.String
parseInterval()
Parse an OSGi interval from the current position.java.lang.String
parseName()
Parses the text string (up to the next space) and returns it.java.util.Map
parseParameters()
boolean
parseString(java.lang.String s)
Check if Strings
is foundboolean
parseStringIgnoreCase(java.lang.String s)
Check if Strings
is found ignoring the casejava.lang.String
parseStringLiteral()
Parse a String literaljava.lang.String
parseSymbolicName()
java.lang.String
remaining()
int
skipWS()
Skip over any whitespace from the current position.java.lang.String
toString()
-
-
-
Method Detail
-
getInput
public java.lang.String getInput()
Accessor for the input string.- Returns:
- The input string.
-
getIndex
public int getIndex()
Accessor for the current index in the input string.- Returns:
- The current index.
-
skipWS
public int skipWS()
Skip over any whitespace from the current position.- Returns:
- The new position
-
parseEOS
public boolean parseEOS()
Check if END OF TEXT is reach- Returns:
- true if END OF TEXT is reach
-
parseChar
public boolean parseChar(char c)
Check if charc
is found- Parameters:
c
- the Character to find- Returns:
- true if
c
is found
-
parseChar
public boolean parseChar(char c, char unlessFollowedBy)
Check if charc
is found- Parameters:
c
- the Character to findunlessFollowedBy
- the character to validate it does not followc
- Returns:
- true if
c
is found and not followed byunlessFollowedBy
-
parseIntegerLiteral
public java.math.BigInteger parseIntegerLiteral()
Parse an integer number from the current position.- Returns:
- The integer number parsed (null if not valid).
-
parseString
public boolean parseString(java.lang.String s)
Check if Strings
is found- Parameters:
s
- the String to find- Returns:
- true if
s
is found
-
parseStringIgnoreCase
public boolean parseStringIgnoreCase(java.lang.String s)
Check if Strings
is found ignoring the case- Parameters:
s
- the String to find- Returns:
- true if
s
is found
-
parseIdentifier
public java.lang.String parseIdentifier()
Parse a java identifier from the current position.- Returns:
- The identifier
-
parseInterval
public java.lang.String parseInterval()
Parse an OSGi interval from the current position.- Returns:
- The interval
-
parseName
public java.lang.String parseName()
Parses the text string (up to the next space) and returns it. The name includes '.' characters. This can be used, for example, when parsing a class name wanting to read in the full name (including package) so that it can then be checked for existence in the CLASSPATH.- Returns:
- The name
-
isDecDigit
private final boolean isDecDigit(char c)
Utility to return if a character is a decimal digit.- Parameters:
c
- The character- Returns:
- Whether it is a decimal digit
-
isOctDigit
private final boolean isOctDigit(char c)
Utility to return if a character is a octal digit.- Parameters:
c
- The character- Returns:
- Whether it is a octal digit
-
isHexDigit
private final boolean isHexDigit(char c)
Utility to return if a character is a hexadecimal digit.- Parameters:
c
- The character- Returns:
- Whether it is a hexadecimal digit
-
nextIsSingleQuote
public boolean nextIsSingleQuote()
Utility to return if the next non-whitespace character is a single quote.- Returns:
- Whether it is a single quote at the current point (ignoring whitespace)
-
nextIsDot
public boolean nextIsDot()
Utility to return if the next character is a dot.- Returns:
- Whether it is a dot at the current point
-
nextIsComma
public boolean nextIsComma()
Utility to return if the next character is a comma.- Returns:
- Whether it is a dot at the current point
-
nextIsSemiColon
public boolean nextIsSemiColon()
Utility to return if the next character is a semi-colon.- Returns:
- Whether it is a semi-colon at the current point
-
parseStringLiteral
public java.lang.String parseStringLiteral()
Parse a String literal- Returns:
- the String parsed. null if single quotes or double quotes is found
- Throws:
NucleusUserException
- if an invalid character is found or the CharacterIterator is finished
-
parseEscapedCharacter
private char parseEscapedCharacter()
Parse a escaped character- Returns:
- the escaped char
- Throws:
NucleusUserException
- if a escaped character is not valid
-
remaining
public java.lang.String remaining()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
parseParameters
public java.util.Map parseParameters()
-
parseSymbolicName
public java.lang.String parseSymbolicName()
-
-