Interface Parser<T>


  • public interface Parser<T>
    A Parser provides methods to translate a String to a T. This is intended to support the inverse of toString() on ASN.1 types. See ParserFactory for how to create a Parser for a particular type.
    • Method Detail

      • parse

        T parse​(String str)
        Translates the text of a String to an object of type T. The text should be in the same format as produced by toString(). Checks that there's nothing else in the string but whitespace.
        Parameters:
        str - the text to be parsed
        Returns:
        the parsed object
      • parse

        Parsed<T> parse​(String str,
                        int pos)
        Translates part of the text of a String to an object of type T. The text should be in the same format as produced by toString().
        Parameters:
        str - the text to be parsed
        pos - position in str at which to start parsing
        Returns:
        the parsed object and position in str at which to resume any further parsing
      • getClazz

        Class<T> getClazz()
        Gets the Class of values parsed by this parser.
        Returns:
        Class