org.springframework.expression.spel.support
Class ReflectiveConstructorExecutor

java.lang.Object
  extended by org.springframework.expression.spel.support.ReflectiveConstructorExecutor
All Implemented Interfaces:
ConstructorExecutor

 class ReflectiveConstructorExecutor
extends java.lang.Object
implements ConstructorExecutor

A simple ConstructorExecutor implementation that runs a constructor using reflective invocation.

Since:
3.0
Author:
Andy Clement, Juergen Hoeller

Field Summary
private  int[] argsRequiringConversion
           
private  java.lang.reflect.Constructor<?> ctor
           
private  java.lang.Integer varargsPosition
           
 
Constructor Summary
ReflectiveConstructorExecutor(java.lang.reflect.Constructor<?> ctor, int[] argsRequiringConversion)
           
 
Method Summary
 TypedValue execute(EvaluationContext context, java.lang.Object... arguments)
          Execute a constructor in the specified context using the specified arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ctor

private final java.lang.reflect.Constructor<?> ctor

varargsPosition

private final java.lang.Integer varargsPosition

argsRequiringConversion

private final int[] argsRequiringConversion
Constructor Detail

ReflectiveConstructorExecutor

public ReflectiveConstructorExecutor(java.lang.reflect.Constructor<?> ctor,
                                     int[] argsRequiringConversion)
Method Detail

execute

public TypedValue execute(EvaluationContext context,
                          java.lang.Object... arguments)
                   throws AccessException
Description copied from interface: ConstructorExecutor
Execute a constructor in the specified context using the specified arguments.

Specified by:
execute in interface ConstructorExecutor
Parameters:
context - the evaluation context in which the command is being executed
arguments - the arguments to the constructor call, should match (in terms of number and type) whatever the command will need to run
Returns:
the new object
Throws:
AccessException - if there is a problem executing the command or the CommandExecutor is no longer valid