package ${package}.utils;

import java.lang.reflect.Method;
import java.lang.ReflectiveOperationException;
import java.util.Arrays;
import java.util.List;

public class EnumLoader<T extends Enum> implements Loader<T>{
  private final Class<T> symbolEnumClass;

  public EnumLoader(final Class<T> symbolEnumClass) {
    this.symbolEnumClass = symbolEnumClass;
  }

  public T load(
      final Object doc,
      final String baseUri,
      final LoadingOptions loadingOptions,
      final String docRoot) {
    final String docString = Loader.validateOfJavaType(String.class, doc);
    try {
      final Method m = symbolEnumClass.getMethod("fromDocumentVal", String.class);
      final T val = (T) m.invoke(null, docString);
      return val;
    } catch (final ReflectiveOperationException e) {
      throw new RuntimeException(e);
    }
  }
}

@@ -785,24 +785,163 @@
 eption e) %7B%0A
+      final Throwable cause = e.getCause();%0A      if (cause instanceof RuntimeException) %7B%0A        throw (RuntimeException) cause;%0A      %7D%0A
       throw 

Fix exception handling of enum loader. (#348)