| spoon.reflect.declaration.CtAnnotation
CtAnnotation | public interface CtAnnotation extends CtElement(Code) | | This element defines an annotation, declared on a given annotated element.
< Parameters: A - >type of represented annotation |
getActualAnnotation | A getActualAnnotation()(Code) | | Returns the actual annotation (a dynamic proxy for this element).
NOTE: before using an annotation proxy, you have to make sure that all
the types referenced by the annotation have been compiled and are in the
classpath so that accessed values can be converted into the actual types (
CtAnnotation.getElementValue(String) ).
|
getAnnotationType | CtTypeReference<A> getAnnotationType()(Code) | | Returns the annotation type of this annotation.
a reference to the type of this annotation |
getElementValue | Object getElementValue(String key)(Code) | | Gets a value for a given key (with conversion if needed).
NOTE: in case of a type, the value is converted to the actual type. To
access the type as a reference, use
CtAnnotation.getElementValues() , which
returns a map containing the raw (unconverted) values.
Parameters: key - name of searched value the value or null if not found |
getElementValues | Map<String, Object> getElementValues()(Code) | | Returns this annotation's elements and their values. This is returned in
the form of a map that associates element names with their corresponding
values.
Note that getElementValue("key") is not completely similar
to getElementValues().get("key") since the former converts
type references into the actual types.
this annotation's element names and their values, or an empty mapif there are none |
setAnnotationType | void setAnnotationType(CtTypeReference<? extends Annotation> type)(Code) | | Sets the annotation's type.
Parameters: type - reference to the type of this annotation |
|
|