Top Description Constructors Methods
org.springframework.expression.spel.support

public Class ReflectiveConstructorResolver

extends Object
implements ConstructorResolver
Class Inheritance
All Implemented Interfaces
org.springframework.expression.ConstructorResolver
Imports
java.lang.reflect.Constructor, java.util.ArrayList, .Arrays, .Comparator, .List, org.springframework.core.MethodParameter, org.springframework.core.convert.TypeDescriptor, org.springframework.expression.AccessException, .ConstructorExecutor, .ConstructorResolver, .EvaluationContext, .EvaluationException, .TypeConverter, org.springframework.lang.Nullable

A constructor resolver that uses reflection to locate the constructor that should be invoked.
Authors
Andy Clement, Juergen Hoeller
Since
3.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ConstructorExecutor
resolve(EvaluationContext
the current evaluation context
context
,
String
the fully-qualified name of the type upon which to look for the constructor
typeName
,
List<TypeDescriptor>
the types of arguments that the constructor must be able to handle
argumentTypes
)

Implements org.springframework.expression.ConstructorResolver.resolve.

Locate a constructor on the type.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ReflectiveConstructorResolverback to summary
public ReflectiveConstructorResolver()

Method Detail

resolveback to summary
public ConstructorExecutor resolve(EvaluationContext context, String typeName, List<TypeDescriptor> argumentTypes) throws AccessException

Implements org.springframework.expression.ConstructorResolver.resolve.

Locate a constructor on the type.

There are three kinds of matches that might occur:

  1. An exact match where the types of the arguments match the types of the constructor.
  2. An inexact match where the types we are looking for are subtypes of those defined on the constructor.
  3. A match where we are able to convert the arguments into those expected by the constructor, according to the registered type converter.
Parameters
context:EvaluationContext

Doc from org.springframework.expression.ConstructorResolver.resolve.

the current evaluation context

typeName:String

Doc from org.springframework.expression.ConstructorResolver.resolve.

the fully-qualified name of the type upon which to look for the constructor

argumentTypes:List<TypeDescriptor>

Doc from org.springframework.expression.ConstructorResolver.resolve.

the types of arguments that the constructor must be able to handle

Returns:ConstructorExecutor

Doc from org.springframework.expression.ConstructorResolver.resolve.

a ConstructorExecutor that can invoke the constructor, or null if the constructor cannot be found

Annotations
@Override
@Nullable