|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.beans.factory.config.DependencyDescriptor
public class DependencyDescriptor
Descriptor for a specific dependency that is about to be injected. Wraps a constructor parameter, a method parameter or a field, allowing unified access to their metadata.
Constructor Summary | |
---|---|
DependencyDescriptor(Field field,
boolean required)
Create a new descriptor for a field. |
|
DependencyDescriptor(MethodParameter methodParameter,
boolean required)
Create a new descriptor for a method or constructor parameter. |
Method Summary | |
---|---|
Object[] |
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. |
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. |
boolean |
isRequired()
Return whether this dependency is required. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DependencyDescriptor(MethodParameter methodParameter, boolean required)
methodParameter
- the MethodParameter to wraprequired
- whether the dependency is requiredpublic DependencyDescriptor(Field field, boolean required)
field
- the field to wraprequired
- whether the dependency is requiredMethod Detail |
---|
public 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 Class getDependencyType()
null
)public Class getCollectionType()
null
if nonepublic Class getMapKeyType()
null
if nonepublic Class getMapValueType()
null
if nonepublic Object[] getAnnotations()
null
if there is
no annotation support (on JDK < 1.5). The return value is an Object array
instead of an Annotation array simply for compatibility with older JDKs;
feel free to cast it to Annotation[]
on JDK 1.5 or higher.
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |