Class GSERParser

java.lang.Object
org.forgerock.opendj.ldap.GSERParser

public final 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.
See Also:
  • Constructor Details

    • GSERParser

      public GSERParser(CharSequence value)
      Creates a new GSER Parser.
      Parameters:
      value - the GSER encoded String value
  • Method Details

    • hasNext

      public boolean hasNext()
      Determines if the GSER String contains at least one character to be read.
      Returns:
      true if there is at least one remaining character or false otherwise.
    • skipSP

      Skips the input matching zero, one or more space characters.
      Returns:
      reference to this GSERParser
      Throws:
      DecodeException - If no match could be found
    • skipMSP

      Skips the input matching one or more space characters.
      Returns:
      reference to this GSERParser
      Throws:
      DecodeException - If no match could be found
    • readStartSequence

      Skips the input matching the start of a sequence and subsequent space characters.
      Returns:
      reference to this GSERParser
      Throws:
      DecodeException - If the input does not match the start of a sequence
    • readEndSequence

      Skips the input matching the end of a sequence and preceding space characters.
      Returns:
      reference to this GSERParser
      Throws:
      DecodeException - If the input does not match the end of a sequence
    • skipSeparator

      Skips the input matching the separator pattern (",") and subsequenct space characters.
      Returns:
      reference to this GSERParser
      Throws:
      DecodeException - If the input does not match the separator pattern.
    • nextString

      Returns the next element as a String.
      Returns:
      the input matching the String pattern
      Throws:
      DecodeException - If the input does not match the string pattern.
    • nextInteger

      public int nextInteger() throws DecodeException
      Returns the next element as an Integer.
      Returns:
      the input matching the integer pattern
      Throws:
      DecodeException - If the input does not match the integer pattern
    • nextBigInteger

      Returns the next element as a BigInteger.
      Returns:
      the input matching the integer pattern
      Throws:
      DecodeException - If the input does not match the integer pattern
    • nextNamedValueIdentifier

      Returns the identifier of the next NamedValue element.
      Returns:
      the identifier of the NamedValue element
      Throws:
      DecodeException - If the input does not match the identifier pattern of a NamedValue
    • nextChoiceValueIdentifier

      Return the identifier of the next IdentifiedChoiceValue element.
      Returns:
      the identifier of the IdentifiedChoiceValue element
      Throws:
      DecodeException - If the input does not match the identifier pattern of an IdentifiedChoiceValue
    • toString

      public String toString()
      Returns the GSER encoded String value.
      Overrides:
      toString in class Object
      Returns:
      The GSER encoded String value.