Class ParserUtils


  • public class ParserUtils
    extends Object
    Helper util methods for Parsers themselves.
    • Constructor Detail

      • ParserUtils

        public ParserUtils()
    • Method Detail

      • cloneMetadata

        public static Metadata cloneMetadata​(Metadata m)
        Does a deep clone of a Metadata object.
      • getParserClassname

        public static String getParserClassname​(Parser parser)
        Identifies the real class name of the Parser, unwrapping any ParserDecorator decorations on top of it.
      • recordParserDetails

        public static void recordParserDetails​(Parser parser,
                                               Metadata metadata)
        Records details of the Parser used to the Metadata, typically wanted where multiple parsers could be picked between or used.
      • recordParserFailure

        public static void recordParserFailure​(Parser parser,
                                               Throwable failure,
                                               Metadata metadata)
        Records details of a Parser's failure to the Metadata, so you can check what went wrong even if the Exception wasn't immediately thrown (eg when several different Parsers are used)