Class ParserUtils


  • public class ParserUtils
    extends java.lang.Object
    Input parser utility methods.
    Author:
    Holger Eichelberger, SSE
    • Constructor Summary

      Constructors 
      Constructor Description
      ParserUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static InputParser<?> createInstance​(java.lang.ClassLoader loader, java.lang.String className, java.lang.String charset)
      Convenience method for creating (custom) parser instances.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ParserUtils

        public ParserUtils()
    • Method Detail

      • createInstance

        public static InputParser<?> createInstance​(java.lang.ClassLoader loader,
                                                    java.lang.String className,
                                                    java.lang.String charset)
        Convenience method for creating (custom) parser instances.
        Parameters:
        loader - the class loader to load the class with
        className - the name of the parser class (must implement InputParser and provide a single String constructor taking the charset encoding or as fallback a no-argument constructor)
        charset - the name of the charset encoding
        Returns:
        the parser instance (null if the parser cannot be found/initialized)