annotation structure.
An instance of this class is returned by
getAnnotations() in AnnotationsAttribute
or in ParameterAnnotationsAttribute.
javassist.bytecode.AnnotationsAttribute#getAnnotations() , javassist.bytecode.ParameterAnnotationsAttribute#getAnnotations() , MemberValue, MemberValueVisitor, AnnotationsWriter
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Map | |
| pack-priv ConstPool | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| public | Annotation(int
the index into the constant pool table.
the entry at that index must be the
type, ConstPool CONSTANT_Utf8_Info structure
repreenting the name of the annotation interface type.the constant pool table. cp)Constructs an annotation including no members. |
| public | Annotation(String
the fully-qualified name of the annotation interface type. typeName, ConstPool the constant pool table. cp)Constructs an annotation including no members. |
| public | Annotation(ConstPool
the constant pool table. cp, CtClass the interface. clazz)Constructs an annotation that can be accessed through the interface
represented by |
| Modifier and Type | Method and Description |
|---|---|
| public void | addMemberValue(int
the index into the constant pool table.
The entry at that index must be
a nameIndex, MemberValue CONSTANT_Utf8_info structure.
structure representing the member name.the member value. value)Adds a new member. |
| public void | |
| private void | |
| public static MemberValue | Returns: the member valuethe constant pool table. cp, CtClass the type of the member. type)Makes an instance of |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Returns true if the given object represents the same annotation as this object. |
| public Set | |
| public MemberValue | Returns: null if the member cannot be found or if the value is the default value.the member name name)Obtains the member value with the given name. |
| public String | |
| public int | |
| public Object | Returns: the annotationclass loader for loading an annotation type. cl, ClassPool class pool for obtaining class files. cp)Constructs an annotation-type object representing this annotation. |
| public String | |
| public void |
| members | back to summary |
|---|---|
| pack-priv Map<String, Annotation. | |
| pool | back to summary |
|---|---|
| pack-priv ConstPool pool | |
| typeIndex | back to summary |
|---|---|
| pack-priv int typeIndex | |
| Annotation | back to summary |
|---|---|
| public Annotation(int type, ConstPool cp) Constructs an annotation including no members. A member can be
later added to the created annotation by
| |
| Annotation | back to summary |
|---|---|
| public Annotation(String typeName, ConstPool cp) Constructs an annotation including no members. A member can be
later added to the created annotation by
| |
| Annotation | back to summary |
|---|---|
| public Annotation(ConstPool cp, CtClass clazz) throws NotFoundException Constructs an annotation that can be accessed through the interface
represented by
| |
| addMemberValue | back to summary |
|---|---|
| public void addMemberValue(int nameIndex, MemberValue value) Adds a new member.
| |
| addMemberValue | back to summary |
|---|---|
| public void addMemberValue(String name, MemberValue value) Adds a new member.
| |
| addMemberValue | back to summary |
|---|---|
| private void addMemberValue(Annotation. | |
| createMemberValue | back to summary |
|---|---|
| public static MemberValue createMemberValue(ConstPool cp, CtClass type) throws NotFoundException Makes an instance of
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Returns true if the given object represents the same annotation as this object. The equality test checks the member values.
| |
| getMemberNames | back to summary |
|---|---|
| public Set Obtains all the member names. | |
| getMemberValue | back to summary |
|---|---|
| public MemberValue getMemberValue(String name) Obtains the member value with the given name. If this annotation does not have a value for the
specified member,
this method returns null. It does not return a
| |
| getTypeName | back to summary |
|---|---|
| public String getTypeName() Obtains the name of the annotation type.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toAnnotationType | back to summary |
|---|---|
| public Object toAnnotationType(ClassLoader cl, ClassPool cp) throws ClassNotFoundException, NoSuchClassError Constructs an annotation-type object representing this annotation.
For example, if this annotation represents
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of the annotation.
| |
| write | back to summary |
|---|---|
| public void write(AnnotationsWriter writer) throws IOException Writes this annotation.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv MemberValue |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| name | back to summary |
|---|---|
| pack-priv int name | |
| value | back to summary |
|---|---|
| pack-priv MemberValue value | |
| Pair | back to summary |
|---|---|
| pack-priv Pair() | |