public static class Annotations.Handle extends java.lang.Object implements IAnnotationHandle
AnnotationNode to support access via common interface| Modifier and Type | Method and Description |
|---|---|
boolean |
exists()
Get whether the annotation inside the handle actually exists, if the
contained element is null, returns false.
|
IAnnotationHandle |
getAnnotation(java.lang.String key)
Get an annotation value as an annotation handle
|
java.util.List<IAnnotationHandle> |
getAnnotationList(java.lang.String key)
Retrieve an annotation key as a list of annotation handles
|
java.lang.String |
getDesc()
Get the annotation descriptor
|
<T> java.util.List<T> |
getList(java.lang.String key)
Retrieve the annotation value with the specified key as a list with
values of the specified type.
|
org.objectweb.asm.tree.AnnotationNode |
getNode() |
java.util.List<org.objectweb.asm.Type> |
getTypeList(java.lang.String key)
Retrieve an annotation key as a list of Types.
|
org.objectweb.asm.Type |
getTypeValue(java.lang.String key)
Get an annotation value as an ASM
Type. |
<T> T |
getValue()
Get the annotation value or return null if not present or not set
|
<T> T |
getValue(java.lang.String key)
Get the annotation value with the specified key or return null if not
present or not set
|
<T> T |
getValue(java.lang.String key,
T defaultValue)
Get a value with the specified key from this annotation, return the
specified default value if the key is not set or is not present
|
java.lang.String |
toString() |
public boolean exists()
IAnnotationHandleexists in interface IAnnotationHandlepublic org.objectweb.asm.tree.AnnotationNode getNode()
public java.lang.String getDesc()
IAnnotationHandlegetDesc in interface IAnnotationHandlepublic java.util.List<IAnnotationHandle> getAnnotationList(java.lang.String key)
IAnnotationHandlegetAnnotationList in interface IAnnotationHandlekey - key to fetchpublic org.objectweb.asm.Type getTypeValue(java.lang.String key)
IAnnotationHandleType. This is special-cased
because the different APIs return class literals in different ways. Under
ASM we will receieve Type instances, but at compile time we will
get TypeMirrors instead. This overload is provided so that
subclasses have to marshal everything into Type for consistency.getTypeValue in interface IAnnotationHandlekey - key to fetchpublic java.util.List<org.objectweb.asm.Type> getTypeList(java.lang.String key)
IAnnotationHandleType instances, but at compile time we will
get TypeMirrors instead. This overload is provided so that
subclasses have to marshal everything into Type for consistency.getTypeList in interface IAnnotationHandlekey - key to fetchpublic IAnnotationHandle getAnnotation(java.lang.String key)
IAnnotationHandlegetAnnotation in interface IAnnotationHandlekey - key to search for in the value mappublic <T> T getValue(java.lang.String key,
T defaultValue)
IAnnotationHandlegetValue in interface IAnnotationHandleT - duck typekey - keydefaultValue - value to return if the key is not set or not presentpublic <T> T getValue()
IAnnotationHandlegetValue in interface IAnnotationHandleT - duck typepublic <T> T getValue(java.lang.String key)
IAnnotationHandlegetValue in interface IAnnotationHandleT - duck typekey - key to fetchpublic <T> java.util.List<T> getList(java.lang.String key)
IAnnotationHandlegetList in interface IAnnotationHandleT - list element duck typekey - key to fetchpublic java.lang.String toString()
toString in class java.lang.Object