Пример #1
0
 public Class<?> getJavaClass(final Type type) {
   Class<?> result = JavaPrimitiveTypes.javaClass(type);
   if (result == null) {
     String className = getCustomPrimitivesMapping().get(type.getName());
     if (className == null) {
       throw new IllegalStateException("Mapping for " + type + " is not defined");
     }
     try {
       result = Thread.currentThread().getContextClassLoader().loadClass(className);
     } catch (ClassNotFoundException e) {
       throw new RuntimeException(e);
     }
   }
   return result;
 }
Пример #2
0
 public String getSequenceItemClassName(final Class<?> javaType) {
   return getSequenceCollectionName() != null
       ? JavaPrimitiveTypes.box(javaType).getCanonicalName()
       : javaType.getCanonicalName();
 }