Package org.datanucleus.plugin
Class PluginParser.Parser
java.lang.Object
org.datanucleus.plugin.PluginParser.Parser
- Enclosing class:
PluginParser
Parser for a list of Bundle-Description
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getIndex()
Accessor for the current index in the input string.getInput()
Accessor for the input string.private final boolean
isDecDigit
(char c) Utility to return if a character is a decimal digit.private final boolean
isHexDigit
(char c) Utility to return if a character is a hexadecimal digit.private final boolean
isOctDigit
(char c) Utility to return if a character is a octal digit.boolean
Utility to return if the next character is a comma.boolean
Utility to return if the next character is a dot.boolean
Utility to return if the next character is a semi-colon.boolean
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
Parse a escaped characterParse a java identifier from the current position.Parse an integer number from the current position.Parse an OSGi interval from the current position.Parses the text string (up to the next space) and returns it.boolean
Check if Strings
is foundboolean
Check if Strings
is found ignoring the caseParse a String literalint
skipWS()
Skip over any whitespace from the current position.toString()
-
Field Details
-
input
-
ci
-
-
Constructor Details
-
Parser
Constructor- Parameters:
input
- The input string
-
-
Method Details
-
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
Parse an integer number from the current position.- Returns:
- The integer number parsed (null if not valid).
-
parseString
Check if Strings
is found- Parameters:
s
- the String to find- Returns:
- true if
s
is found
-
parseStringIgnoreCase
Check if Strings
is found ignoring the case- Parameters:
s
- the String to find- Returns:
- true if
s
is found
-
parseIdentifier
Parse a java identifier from the current position.- Returns:
- The identifier
-
parseInterval
Parse an OSGi interval from the current position.- Returns:
- The interval
-
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
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
-
toString
-
parseParameters
-
parseSymbolicName
-