Class ParserUtils


  • public class ParserUtils
    extends java.lang.Object
    Helper util methods for Parsers themselves.
    • Field Detail

      • EMBEDDED_PARSER

        public static final Property EMBEDDED_PARSER
      • EMBEDDED_EXCEPTION

        public static final Property EMBEDDED_EXCEPTION
    • 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 java.lang.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,
                                               java.lang.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)