Ejemplo n.º 1
0
 @SuppressWarnings("unchecked")
 public static Class<? extends Parser<?>> parserOrNull(
     final Class<?> candidateClass, final String classCandidateName) {
   @SuppressWarnings("rawtypes")
   final Class type =
       candidateClass != null
           ? ClassUtil.implementingClassOrNull(
               candidateClass.getName(), Parser.class, FacetHolder.class)
           : null;
   return type != null
       ? type
       : ClassUtil.implementingClassOrNull(classCandidateName, Parser.class, FacetHolder.class);
 }
 private Class<?> loadBuiltIn(final String className) throws ClassNotFoundException {
   final Class<?> builtIn = ClassUtil.getBuiltIn(className);
   if (builtIn != null) {
     return builtIn;
   }
   return Class.forName(className);
 }