public class AnnotationReader extends EmptyAnnotationVisitor implements AnnotationInfo
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
className |
protected java.lang.String |
desc |
protected java.util.Map<java.lang.String,java.lang.Object> |
elements |
static AnnotationInfo[] |
NO_ANNOTATIONS |
protected boolean |
visible |
api, av
Constructor and Description |
---|
AnnotationReader(java.lang.String desc,
boolean visible) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAnnotationClassname() |
java.lang.String |
getAnnotationSignature() |
java.lang.Object |
getElement(java.lang.String name)
Lookups for annotation element.
|
java.util.Set<java.lang.String> |
getElementNames()
Returns annotation element names.
|
boolean |
isVisible() |
void |
visit(java.lang.String name,
java.lang.Object value)
Visits a primitive value of the annotation.
|
AnnotationVisitor |
visitAnnotation(java.lang.String name,
java.lang.String desc)
Visits a nested annotation value of the annotation.
|
AnnotationVisitor |
visitArray(java.lang.String name)
Visits an array value of the annotation.
|
void |
visitEnum(java.lang.String name,
java.lang.String desc,
java.lang.String value)
Visits an enumeration value of the annotation.
|
visitEnd
public static final AnnotationInfo[] NO_ANNOTATIONS
protected final java.lang.String desc
protected final java.lang.String className
protected final boolean visible
protected final java.util.Map<java.lang.String,java.lang.Object> elements
public java.lang.String getAnnotationClassname()
getAnnotationClassname
in interface AnnotationInfo
public java.lang.String getAnnotationSignature()
getAnnotationSignature
in interface AnnotationInfo
public boolean isVisible()
isVisible
in interface AnnotationInfo
public java.lang.Object getElement(java.lang.String name)
AnnotationInfo
getElement
in interface AnnotationInfo
public java.util.Set<java.lang.String> getElementNames()
AnnotationInfo
getElementNames
in interface AnnotationInfo
public void visit(java.lang.String name, java.lang.Object value)
AnnotationVisitor
visit
in class AnnotationVisitor
name
- the value name.value
- the actual value, whose type must be Byte
, Boolean
, Character
, Short
, Integer
, Long
, Float
, Double
,
String
or Type
of Type.OBJECT
or Type.ARRAY
sort. This
value can also be an array of byte, boolean, short, char, int, long, float or double values
(this is equivalent to using AnnotationVisitor.visitArray(java.lang.String)
and visiting each array element in turn,
but is more convenient).public void visitEnum(java.lang.String name, java.lang.String desc, java.lang.String value)
AnnotationVisitor
visitEnum
in class AnnotationVisitor
name
- the value name.desc
- the class descriptor of the enumeration class.value
- the actual enumeration value.public AnnotationVisitor visitAnnotation(java.lang.String name, java.lang.String desc)
AnnotationVisitor
visitAnnotation
in class AnnotationVisitor
name
- the value name.desc
- the class descriptor of the nested annotation class.public AnnotationVisitor visitArray(java.lang.String name)
AnnotationVisitor
visit
. This is what ClassReader
does.visitArray
in class AnnotationVisitor
name
- the value name.Copyright © 2003-present Jodd Team