public ConstructorBeanCreator(Class<?> ofClass, Constructor<?> constructor, String[] parameterNames, Type[] expandedParameterTypes) { // We can use the same class, as anyway we don't want to use constructors super(ofClass, ofClass, ofClass, parameterNames, expandedParameterTypes, constructor.getParameterAnnotations()); this.constructor = constructor; if (!constructor.isAccessible()) { constructor.setAccessible(true); } decorate(constructor); }
public Object create(Object... args) { try { return constructor.newInstance(args); } catch (IllegalArgumentException e) { throw couldNotCreate(e); } catch (InstantiationException e) { throw couldNotCreate(e); } catch (IllegalAccessException e) { throw couldNotCreate(e); } catch (InvocationTargetException e) { throw couldNotCreate(e); } }
public Object create(Object... args) { try { return constructor.newInstance(args); } catch (IllegalArgumentException e) { throw couldNotCreate(e); } catch (InstantiationException e) { throw couldNotCreate(e); } catch (IllegalAccessException e) { throw couldNotCreate(e); } catch (InvocationTargetException e) { throw couldNotCreate(e); } }
public BeanCreator createCreator(Type ofType, Constructor<?> ctr, String[] resolvedNames, Genson genson) { return new BeanCreator.ConstructorBeanCreator(getRawClass(ofType), ctr, resolvedNames, expandTypes(ctr.getGenericParameterTypes(), ofType)); }
public BeanCreator createCreator(Type ofType, Constructor<?> ctr, String[] resolvedNames, Genson genson) { return new BeanCreator.ConstructorBeanCreator(getRawClass(ofType), ctr, resolvedNames, expandTypes(ctr.getGenericParameterTypes(), ofType)); }
public ConstructorBeanCreator(Class<?> ofClass, Constructor<?> constructor, String[] parameterNames, Type[] expandedParameterTypes) { // We can use the same class, as anyway we don't want to use constructors super(ofClass, ofClass, ofClass, parameterNames, expandedParameterTypes, constructor.getParameterAnnotations()); this.constructor = constructor; if (!constructor.isAccessible()) { constructor.setAccessible(true); } decorate(constructor); }