public class Annotation extends java.lang.Object implements BCEntity, VisitAcceptor
| Modifier and Type | Class and Description |
|---|---|
static class |
Annotation.Property
An annotation property.
|
| Modifier and Type | Method and Description |
|---|---|
void |
acceptVisit(BCVisitor visit)
Accept a visit from a
BCVisitor, calling the appropriate methods
to notify the visitor that it has entered this entity, and
to provide it with the proper callbacks for each sub-entity owned
by this one. |
Annotation.Property |
addProperty(Annotation.Property p)
Import a property from another instance.
|
Annotation.Property |
addProperty(java.lang.String name)
Add a new property.
|
void |
clearProperties()
Clear all annotation properties.
|
java.lang.ClassLoader |
getClassLoader()
Return the class loader to use when loading related classes.
|
BCEntity |
getOwner()
Annotations are stored in an
Annotations table or as
part of an Annotation property value. |
ConstantPool |
getPool()
Return the constant pool of the current class.
|
Project |
getProject()
Return the project of the current class.
|
Annotation.Property[] |
getProperties()
All declared properties.
|
Annotation.Property |
getProperty(java.lang.String name)
Return the property with the given name, or null if none.
|
java.lang.Class |
getType()
The
Class object for this annotation's type. |
BCClass |
getTypeBC()
The bytecode for the type of this annotation.
|
int |
getTypeIndex()
The index in the class
ConstantPool of the
UTF8Entry holding the type of this annotation. |
java.lang.String |
getTypeName()
The name of this annotation's type.
|
boolean |
isValid()
Return false if this entity has been removed from its parent; in this
case the results of any operations on the entity are undefined.
|
boolean |
removeProperty(Annotation.Property prop)
Remove the given property.
|
boolean |
removeProperty(java.lang.String name)
Remove the property with the given name.
|
void |
setProperties(Annotation.Property[] props)
Set the annotation properties.
|
void |
setType(BCClass type)
This annotation's type.
|
void |
setType(java.lang.Class type)
This annotation's type.
|
void |
setType(java.lang.String type)
This annotation's type.
|
void |
setTypeIndex(int index)
The index in the class
ConstantPool of the
UTF8Entry holding the type of this annotation. |
public BCEntity getOwner()
Annotations table or as
part of an Annotation property value.public int getTypeIndex()
ConstantPool of the
UTF8Entry holding the type of this annotation.public void setTypeIndex(int index)
ConstantPool of the
UTF8Entry holding the type of this annotation.public java.lang.String getTypeName()
public java.lang.Class getType()
Class object for this annotation's type.public void setType(java.lang.String type)
public void setType(java.lang.Class type)
public Annotation.Property[] getProperties()
public void setProperties(Annotation.Property[] props)
public Annotation.Property getProperty(java.lang.String name)
public Annotation.Property addProperty(Annotation.Property p)
public Annotation.Property addProperty(java.lang.String name)
public void clearProperties()
public boolean removeProperty(Annotation.Property prop)
public boolean removeProperty(java.lang.String name)
public Project getProject()
BCEntitygetProject in interface BCEntitypublic ConstantPool getPool()
BCEntitypublic java.lang.ClassLoader getClassLoader()
BCEntitygetClassLoader in interface BCEntitypublic boolean isValid()
BCEntitypublic void acceptVisit(BCVisitor visit)
VisitAcceptorBCVisitor, calling the appropriate methods
to notify the visitor that it has entered this entity, and
to provide it with the proper callbacks for each sub-entity owned
by this one.acceptVisit in interface VisitAcceptorCopyright © 2002-2013. All Rights Reserved.