Ejemplo n.º 1
0
 public void registerAlias(String alias, String value) {
   try {
     registerAlias(alias, Resources.classForName(value));
   } catch (ClassNotFoundException e) {
     throw new TypeException(
         "Error registering type alias " + alias + " for " + value + ". Cause: " + e, e);
   }
 }
Ejemplo n.º 2
0
 public Class resolveAlias(String string) {
   try {
     if (string == null) return null;
     String key = string.toLowerCase();
     Class value;
     if (TYPE_ALIASES.containsKey(key)) {
       value = TYPE_ALIASES.get(key);
     } else {
       value = Resources.classForName(string);
     }
     return value;
   } catch (ClassNotFoundException e) {
     throw new TypeException("Could not resolve type alias '" + string + "'.  Cause: " + e, e);
   }
 }