Package org.opends.server.protocols.asn1
Class GSERParser
- java.lang.Object
-
- org.opends.server.protocols.asn1.GSERParser
-
public class GSERParser extends Object
This class implements a parser for strings which are encoded using the Generic String Encoding Rules (GSER) defined in RFC 3641.
-
-
Constructor Summary
Constructors Constructor Description GSERParser(String value)Creates a new GSER Parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Determines if the GSER String contains at least one character to be read.BigIntegernextBigInteger()Returns the next element as a BigInteger.StringnextChoiceValueIdentifier()Return the identifier of the next IdentifiedChoiceValue element.intnextInteger()Returns the next element as an Integer.StringnextNamedValueIdentifier()Returns the identifier of the next NamedValue element.StringnextString()Returns the next element as a String.GSERParserreadEndSequence()Skips the input matching the end of a sequence and preceding space characters.GSERParserreadStartSequence()Skips the input matching the start of a sequence and subsequent space characters.GSERParserskipMSP()Skips the input matching one or more space characters.GSERParserskipSeparator()Skips the input matching the separator pattern (",") and subsequenct space characters.GSERParserskipSP()Skips the input matching zero, one or more space characters.
-
-
-
Constructor Detail
-
GSERParser
public GSERParser(String value)
Creates a new GSER Parser.- Parameters:
value- the GSER encoded String value
-
-
Method Detail
-
hasNext
public boolean hasNext()
Determines if the GSER String contains at least one character to be read.- Returns:
trueif there is at least one remaining character orfalseotherwise.
-
skipSP
public GSERParser skipSP() throws GSERException
Skips the input matching zero, one or more space characters.- Returns:
- reference to this GSERParser
- Throws:
GSERException- If no match could be found
-
skipMSP
public GSERParser skipMSP() throws GSERException
Skips the input matching one or more space characters.- Returns:
- reference to this GSERParser
- Throws:
GSERException- If no match could be found
-
readStartSequence
public GSERParser readStartSequence() throws GSERException
Skips the input matching the start of a sequence and subsequent space characters.- Returns:
- reference to this GSERParser
- Throws:
GSERException- If the input does not match the start of a sequence
-
readEndSequence
public GSERParser readEndSequence() throws GSERException
Skips the input matching the end of a sequence and preceding space characters.- Returns:
- reference to this GSERParser
- Throws:
GSERException- If the input does not match the end of a sequence
-
skipSeparator
public GSERParser skipSeparator() throws GSERException
Skips the input matching the separator pattern (",") and subsequenct space characters.- Returns:
- reference to this GSERParser
- Throws:
GSERException- If the input does not match the separator pattern.
-
nextString
public String nextString() throws GSERException
Returns the next element as a String.- Returns:
- the input matching the String pattern
- Throws:
GSERException- If the input does not match the string pattern.
-
nextInteger
public int nextInteger() throws GSERExceptionReturns the next element as an Integer.- Returns:
- the input matching the integer pattern
- Throws:
GSERException- If the input does not match the integer pattern
-
nextBigInteger
public BigInteger nextBigInteger() throws GSERException
Returns the next element as a BigInteger.- Returns:
- the input matching the integer pattern
- Throws:
GSERException- If the input does not match the integer pattern
-
nextNamedValueIdentifier
public String nextNamedValueIdentifier() throws GSERException
Returns the identifier of the next NamedValue element.- Returns:
- the identifier of the NamedValue element
- Throws:
GSERException- If the input does not match the identifier pattern of a NamedValue
-
nextChoiceValueIdentifier
public String nextChoiceValueIdentifier() throws GSERException
Return the identifier of the next IdentifiedChoiceValue element.- Returns:
- the identifier of the IdentifiedChoiceValue element
- Throws:
GSERException- If the input does not match the identifier pattern of an IdentifiedChoiceValue
-
-