@Test(expected = ReflectionException.class) public void construction_exception() { TypeDescriptor type = TYPES.get(Cycle.class); type.newInstance(); }
public Object newInstance() { Constructor<?> constructor; try { constructor = getRawType().getDeclaredConstructor(); constructor.setAccessible(true); return constructor.newInstance(); } catch (Exception e) { throw new ReflectionException(toString(), e); } }
TypeDescriptor implements ElementDescriptor { public Object newInstance() { Constructor<?> constructor; try { constructor = getRawType().getDeclaredConstructor(); constructor.setAccessible(true); return constructor.newInstance(); } catch (Exception e) { throw new ReflectionException(toString(), e); } } }
TypeDescriptor implements ElementDescriptor { public Object newInstance() { Constructor<?> constructor; try { constructor = getRawType().getDeclaredConstructor(); constructor.setAccessible(true); return constructor.newInstance(); } catch (Exception e) { throw new ReflectionException(toString(), e); } } TypeDescriptor(TypeDescriptors typeDescriptors, TypeToken<?> typeToken); }
TypeDescriptor implements ElementDescriptor { public Object newInstance() { Constructor<?> constructor; try { constructor = getRawType().getDeclaredConstructor(); constructor.setAccessible(true); return constructor.newInstance(); } catch (Exception e) { throw new ReflectionException(toString(), e); } } TypeDescriptor(TypeDescriptors typeDescriptors, TypeToken<?> typeToken); List<Annotation> getAnnotations(); A getAnnotation(Class<A> annotationClass); boolean hasAnnotation(Class<A> annotationClass); boolean equalTo(TypeDescriptor type); boolean equalTo(Class<?> type); Map<String, FieldDescriptor> getFields(); String getName(); String getSimpleName(); static String getSimpleName(Class<?> cls); Map<ConstructorSignature, ConstructorDescriptor> getConstructors(); Map<MethodSignature, MethodDescriptor> getMethods(); Map<String, BeanProperty> getProperties(); boolean hasField(String fieldName); FieldDescriptor getField(String name); TypeDescriptor resolveGenericParameter(Class<?> genericClass, int genericParam); Class<?> getRawType(); TypeToken<?> getTypeToken(); boolean isPrimitiveOrWrapper(); boolean isSuperTypeOf(TypeDescriptor type); boolean isSuperTypeOf(Class<?> clazz); boolean isSubTypeOf(TypeDescriptor type); boolean isSubTypeOf(Class<?> clazz); boolean isEnum(); ConstructorDescriptor getDefaultConstructor(); Object newInstance(); TypeDescriptors getTypeDescriptors(); @Override final boolean equals(Object obj); @Override final int hashCode(); @Override String toString(); boolean isAbstract(); boolean isArray(); TypeDescriptor getComponentType(); }
TypeDescriptor implements ElementDescriptor { public Object newInstance() { Constructor<?> constructor; try { constructor = getRawType().getDeclaredConstructor(); constructor.setAccessible(true); return constructor.newInstance(); } catch (Exception e) { throw new ReflectionException(toString(), e); } } TypeDescriptor(TypeDescriptors typeDescriptors, TypeToken<?> typeToken); List<Annotation> getAnnotations(); A getAnnotation(Class<A> annotationClass); boolean hasAnnotation(Class<A> annotationClass); boolean equalTo(TypeDescriptor type); boolean equalTo(Class<?> type); Map<String, FieldDescriptor> getFields(); String getName(); String getSimpleName(); static String getSimpleName(Class<?> cls); Map<ConstructorSignature, ConstructorDescriptor> getConstructors(); Map<MethodSignature, MethodDescriptor> getMethods(); Map<String, BeanProperty> getProperties(); boolean hasField(String fieldName); FieldDescriptor getField(String name); TypeDescriptor resolveGenericParameter(Class<?> genericClass, int genericParam); Class<?> getRawType(); TypeToken<?> getTypeToken(); boolean isPrimitiveOrWrapper(); boolean isSuperTypeOf(TypeDescriptor type); boolean isSuperTypeOf(Class<?> clazz); boolean isSubTypeOf(TypeDescriptor type); boolean isSubTypeOf(Class<?> clazz); boolean isEnum(); ConstructorDescriptor getDefaultConstructor(); Object newInstance(); TypeDescriptors getTypeDescriptors(); @Override final boolean equals(Object obj); @Override final int hashCode(); @Override String toString(); boolean isAbstract(); boolean isArray(); TypeDescriptor getComponentType(); static final BiMap<Class<?>, Class<?>> WRAPPER_TO_PRIMITIVE; }