public class DependencyDescriptor extends Object implements Serializable
Constructor and Description |
---|
DependencyDescriptor(DependencyDescriptor original)
Copy constructor.
|
DependencyDescriptor(Field field,
boolean required)
Create a new descriptor for a field.
|
DependencyDescriptor(Field field,
boolean required,
boolean eager)
Create a new descriptor for a field.
|
DependencyDescriptor(MethodParameter methodParameter,
boolean required)
Create a new descriptor for a method or constructor parameter.
|
DependencyDescriptor(MethodParameter methodParameter,
boolean required,
boolean eager)
Create a new descriptor for a method or constructor parameter.
|
Modifier and Type | Method and Description |
---|---|
Annotation[] |
getAnnotations()
Obtain the annotations associated with the wrapped parameter/field, if any.
|
Class<?> |
getCollectionType()
Determine the generic element type of the wrapped Collection parameter/field, if any.
|
String |
getDependencyName()
Determine the name of the wrapped parameter/field.
|
Class<?> |
getDependencyType()
Determine the declared (non-generic) type of the wrapped parameter/field.
|
Field |
getField()
Return the wrapped Field, if any.
|
Class<?> |
getMapKeyType()
Determine the generic key type of the wrapped Map parameter/field, if any.
|
Class<?> |
getMapValueType()
Determine the generic value type of the wrapped Map parameter/field, if any.
|
MethodParameter |
getMethodParameter()
Return the wrapped MethodParameter, if any.
|
void |
increaseNestingLevel()
Increase this descriptor's nesting level.
|
void |
initParameterNameDiscovery(ParameterNameDiscoverer parameterNameDiscoverer)
Initialize parameter name discovery for the underlying method parameter, if any.
|
boolean |
isEager()
Return whether this dependency is 'eager' in the sense of
eagerly resolving potential target beans for type matching.
|
boolean |
isRequired()
Return whether this dependency is required.
|
public DependencyDescriptor(MethodParameter methodParameter, boolean required)
methodParameter
- the MethodParameter to wraprequired
- whether the dependency is requiredpublic DependencyDescriptor(MethodParameter methodParameter, boolean required, boolean eager)
methodParameter
- the MethodParameter to wraprequired
- whether the dependency is requiredeager
- whether this dependency is 'eager' in the sense of
eagerly resolving potential target beans for type matchingpublic DependencyDescriptor(Field field, boolean required)
field
- the field to wraprequired
- whether the dependency is requiredpublic DependencyDescriptor(Field field, boolean required, boolean eager)
field
- the field to wraprequired
- whether the dependency is requiredeager
- whether this dependency is 'eager' in the sense of
eagerly resolving potential target beans for type matchingpublic DependencyDescriptor(DependencyDescriptor original)
original
- the original descriptor to create a copy frompublic MethodParameter getMethodParameter()
Note: Either MethodParameter or Field is available.
null
if nonepublic Field getField()
Note: Either MethodParameter or Field is available.
null
if nonepublic boolean isRequired()
public boolean isEager()
public void increaseNestingLevel()
public void initParameterNameDiscovery(ParameterNameDiscoverer parameterNameDiscoverer)
This method does not actually try to retrieve the parameter name at
this point; it just allows discovery to happen when the application calls
getDependencyName()
(if ever).
public String getDependencyName()
null
)public Class<?> getDependencyType()
null
)public Class<?> getCollectionType()
null
if nonepublic Class<?> getMapKeyType()
null
if nonepublic Class<?> getMapValueType()
null
if nonepublic Annotation[] getAnnotations()