Class ReflectiveConstructorResolver
java.lang.Object
org.springframework.expression.spel.support.ReflectiveConstructorResolver
- All Implemented Interfaces:
ConstructorResolver
A constructor resolver that uses reflection to locate the constructor that
should be invoked.
- Since:
- 3.0
- Author:
- Andy Clement, Juergen Hoeller
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionresolve
(EvaluationContext context, String typeName, List<TypeDescriptor> argumentTypes) Locate a constructor on the type.
-
Constructor Details
-
ReflectiveConstructorResolver
public ReflectiveConstructorResolver()
-
-
Method Details
-
resolve
@Nullable public ConstructorExecutor resolve(EvaluationContext context, String typeName, List<TypeDescriptor> argumentTypes) throws AccessException Locate a constructor on the type.There are three kinds of matches that might occur:
- An exact match where the types of the arguments match the types of the constructor.
- An inexact match where the types we are looking for are subtypes of those defined on the constructor.
- A match where we are able to convert the arguments into those expected by the constructor, according to the registered type converter.
- Specified by:
resolve
in interfaceConstructorResolver
- Parameters:
context
- the current evaluation contexttypeName
- the fully-qualified name of the type upon which to look for the constructorargumentTypes
- the types of arguments that the constructor must be able to handle- Returns:
- a
ConstructorExecutor
that can invoke the constructor, ornull
if the constructor cannot be found - Throws:
AccessException
-