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.ObjectParser 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 intgetIndex()Accessor for the current index in the input string.java.lang.StringgetInput()Accessor for the input string.private booleanisDecDigit(char c)Utility to return if a character is a decimal digit.private booleanisHexDigit(char c)Utility to return if a character is a hexadecimal digit.private booleanisOctDigit(char c)Utility to return if a character is a octal digit.booleannextIsComma()Utility to return if the next character is a comma.booleannextIsDot()Utility to return if the next character is a dot.booleannextIsSemiColon()Utility to return if the next character is a semi-colon.booleannextIsSingleQuote()Utility to return if the next non-whitespace character is a single quote.booleanparseChar(char c)Check if charcis foundbooleanparseChar(char c, char unlessFollowedBy)Check if charcis foundbooleanparseEOS()Check if END OF TEXT is reachprivate charparseEscapedCharacter()Parse a escaped characterjava.lang.StringparseIdentifier()Parse a java identifier from the current position.java.math.BigIntegerparseIntegerLiteral()Parse an integer number from the current position.java.lang.StringparseInterval()Parse an OSGi interval from the current position.java.lang.StringparseName()Parses the text string (up to the next space) and returns it.java.util.MapparseParameters()booleanparseString(java.lang.String s)Check if Stringsis foundbooleanparseStringIgnoreCase(java.lang.String s)Check if Stringsis found ignoring the casejava.lang.StringparseStringLiteral()Parse a String literaljava.lang.StringparseSymbolicName()java.lang.Stringremaining()intskipWS()Skip over any whitespace from the current position.java.lang.StringtoString()
-
-
-
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 charcis found- Parameters:
c- the Character to find- Returns:
- true if
cis found
-
parseChar
public boolean parseChar(char c, char unlessFollowedBy)Check if charcis found- Parameters:
c- the Character to findunlessFollowedBy- the character to validate it does not followc- Returns:
- true if
cis 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 Stringsis found- Parameters:
s- the String to find- Returns:
- true if
sis found
-
parseStringIgnoreCase
public boolean parseStringIgnoreCase(java.lang.String s)
Check if Stringsis found ignoring the case- Parameters:
s- the String to find- Returns:
- true if
sis 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:
toStringin classjava.lang.Object
-
parseParameters
public java.util.Map parseParameters()
-
parseSymbolicName
public java.lang.String parseSymbolicName()
-
-