Code example for Constructor

Methods: getParameterTypesisVarArgsnewInstance

0
 
	@Override 
	public TypedValue execute(EvaluationContext context, Object... arguments) throws AccessException {
		try { 
			if (arguments != null) { 
				ReflectionHelper.convertArguments(context.getTypeConverter(), arguments, this.ctor, this.varargsPosition);
			} 
			if (this.ctor.isVarArgs()) {
				arguments = ReflectionHelper.setupArgumentsForVarargsInvocation(this.ctor.getParameterTypes(), arguments);
			} 
			ReflectionUtils.makeAccessible(this.ctor);
			return new TypedValue(this.ctor.newInstance(arguments));
		} 
		catch (Exception ex) {
			throw new AccessException("Problem invoking constructor: " + this.ctor, ex);
		} 
	} 
 
	public Constructor<?> getConstructor() {
		return this.ctor;