LinkedHashMap subclass representing annotation attribute
key-value pairs as read by AnnotationUtils,
AnnotatedElementUtils, and Spring's reflection- and ASM-based
org.springframework.core.type.AnnotationMetadata implementations.
Provides 'pseudo-reification' to avoid noisy Map generics in the calling code as well as convenience methods for looking up annotation attributes in a type-safe fashion.
AnnotationUtils#getAnnotationAttributes, AnnotatedElementUtils
| Modifier and Type | Field and Description |
|---|---|
| private final Class | |
| pack-priv final String | |
| private static final String | |
| pack-priv final boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | AnnotationAttributes(int
initial size of the underlying map initialCapacity)Create a new, empty |
| public | AnnotationAttributes(Map<String, Object>
original source of annotation attribute key-value pairs map)Create a new |
| public | AnnotationAttributes(AnnotationAttributes
original source of annotation attribute key-value pairs other)Create a new |
| public | AnnotationAttributes(Class<? extends Annotation>
the type of annotation represented by this
annotationType)AnnotationAttributes instance; never nullCreate a new, empty |
| public | AnnotationAttributes(String
the annotation type name represented by this
annotationType, ClassLoader AnnotationAttributes instance; never nullthe ClassLoader to try to load the annotation type on,
or classLoader)null to just store the annotation type nameCreate a new, empty |
| pack-priv | AnnotationAttributes(Class<? extends Annotation>
the type of annotation represented by this
annotationType, boolean AnnotationAttributes instance; never nullif the attributes are considered already validated validated)Create a possibly already validated new, empty
|
| Modifier and Type | Method and Description |
|---|---|
| public Class | Returns: the annotation type, ornull if unknownGet the type of annotation represented by this |
| private void | |
| private void | |
| private void | |
| public static AnnotationAttributes | fromMap(Map<String, Object>
original source of annotation attribute key-value pairs map)Return an |
| public AnnotationAttributes | Returns: theAnnotationAttributesthe name of the attribute to get;
never attributeName)null or emptyGet the |
| public <A extends Annotation> A | Returns: the annotationthe name of the attribute to get;
never attributeName, Class<A> null or emptythe expected annotation type; never annotationType)nullGet the annotation of type |
| public AnnotationAttributes[] | Returns: the array ofAnnotationAttributesthe name of the attribute to get;
never attributeName)null or emptyGet the array of |
| public <A extends Annotation> A[] | Returns: the annotation arraythe name of the attribute to get;
never attributeName, Class<A> null or emptythe expected annotation type; never annotationType)nullGet the array of type |
| private static Class | |
| public boolean | Returns: the valuethe name of the attribute to get;
never attributeName)null or emptyGet the value stored under the specified |
| public <T> Class | |
| public Class | Returns: the valuethe name of the attribute to get;
never attributeName)null or emptyGet the value stored under the specified |
| public <E extends Enum | |
| public <N extends Number> N | |
| private <T> T | Returns: the valuethe name of the attribute to get;
never attributeName, Class<T> null or emptythe expected type; never expectedType)nullGet the value stored under the specified |
| public String | |
| public String[] | Returns: the valuethe name of the attribute to get;
never attributeName)null or emptyGet the value stored under the specified |
| public String | |
| private String |
| annotationType | back to summary |
|---|---|
| private final Class<? extends Annotation> annotationType
| |
| displayName | back to summary |
|---|---|
| pack-priv final String displayName | |
| UNKNOWN | back to summary |
|---|---|
| private static final String UNKNOWN | |
| validated | back to summary |
|---|---|
| pack-priv final boolean validated | |
| AnnotationAttributes | back to summary |
|---|---|
| public AnnotationAttributes() Create a new, empty | |
| AnnotationAttributes | back to summary |
|---|---|
| public AnnotationAttributes(int initialCapacity) Create a new, empty
| |
| AnnotationAttributes | back to summary |
|---|---|
| public AnnotationAttributes(Map<String, Object> map) Create a new
| |
| AnnotationAttributes | back to summary |
|---|---|
| public AnnotationAttributes(AnnotationAttributes other) Create a new
| |
| AnnotationAttributes | back to summary |
|---|---|
| public AnnotationAttributes(Class<? extends Annotation> annotationType) Create a new, empty
| |
| AnnotationAttributes | back to summary |
|---|---|
| public AnnotationAttributes(String annotationType, ClassLoader classLoader) Create a new, empty
| |
| AnnotationAttributes | back to summary |
|---|---|
| pack-priv AnnotationAttributes(Class<? extends Annotation> annotationType, boolean validated) Create a possibly already validated new, empty
| |
| annotationType | back to summary |
|---|---|
| public Class Get the type of annotation represented by this
| |
| assertAttributePresence | back to summary |
|---|---|
| private void assertAttributePresence(String attributeName, Object attributeValue) | |
| assertAttributeType | back to summary |
|---|---|
| private void assertAttributeType(String attributeName, Object attributeValue, Class<?> expectedType) | |
| assertNotException | back to summary |
|---|---|
| private void assertNotException(String attributeName, Object attributeValue) | |
| fromMap | back to summary |
|---|---|
| public static AnnotationAttributes fromMap(Map<String, Object> map) Return an If the map is already an | |
| getAnnotation | back to summary |
|---|---|
| public AnnotationAttributes getAnnotation(String attributeName) Get the Note if you expect an actual annotation, invoke
| |
| getAnnotation | back to summary |
|---|---|
| public <A extends Annotation> A getAnnotation(String attributeName, Class<A> annotationType) Get the annotation of type
| |
| getAnnotationArray | back to summary |
|---|---|
| public AnnotationAttributes[] getAnnotationArray(String attributeName) Get the array of If the value stored under the specified Note if you expect an actual array of annotations, invoke
| |
| getAnnotationArray | back to summary |
|---|---|
| public <A extends Annotation> A[] getAnnotationArray(String attributeName, Class<A> annotationType) Get the array of type If the value stored under the specified
| |
| getAnnotationType | back to summary |
|---|---|
private static Class
| |
| getBoolean | back to summary |
|---|---|
| public boolean getBoolean(String attributeName) Get the value stored under the specified
| |
| getClass | back to summary |
|---|---|
| public <T> Class Get the value stored under the specified
| |
| getClassArray | back to summary |
|---|---|
| public Class Get the value stored under the specified If the value stored under the specified
| |
| getEnum | back to summary |
|---|---|
| public <E extends Enum Get the value stored under the specified
| |
| getNumber | back to summary |
|---|---|
| public <N extends Number> N getNumber(String attributeName) Get the value stored under the specified
| |
| getRequiredAttribute | back to summary |
|---|---|
| private <T> T getRequiredAttribute(String attributeName, Class<T> expectedType) Get the value stored under the specified If the
| |
| getString | back to summary |
|---|---|
| public String getString(String attributeName) Get the value stored under the specified
| |
| getStringArray | back to summary |
|---|---|
| public String[] getStringArray(String attributeName) Get the value stored under the specified If the value stored under the specified
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of this map. The string representation
consists of a list of key-value mappings in the order returned by the
map's | |
| valueToString | back to summary |
|---|---|
| private String valueToString(Object value) | |