code: public static MessageParser createMessageParser(String className,
                                                      SecorConfig config) throws Exception {
          Class<?> clazz = Class.forName(className);
          if (!MessageParser.class.isAssignableFrom(clazz)) {
              throw new IllegalArgumentException(String.format("The class '%s' is not assignable to '%s'.",
                      className, MessageParser.class.getName()));
          }
  
          // Assume that subclass of MessageParser has a constructor with the same signature as MessageParser
          return (MessageParser) clazz.getConstructor(SecorConfig.class).newInstance(config);
      }
docs: Create a MessageParser from it's fully qualified class name.
  The class passed in by name must be assignable to MessageParser and have 1-parameter constructor accepting a SecorConfig.
  Allows the MessageParser to be pluggable by providing the class name of a desired MessageParser in config.
  
  See the secor.message.parser.class config option.
  
  @param className The class name of a subclass of MessageParser
  @param config The SecorCondig to initialize the MessageParser with
  @return a MessageParser instance with the runtime type of the class passed by name
  @throws Exception on error