Package serp.bytecode
Class Annotation
java.lang.Object
serp.bytecode.Annotation
- All Implemented Interfaces:
BCEntity,VisitAcceptor
A declared annotation.
- Author:
- Abe White
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptVisit(BCVisitor visit) Accept a visit from aBCVisitor, 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.addProperty(String name) Add a new property.Import a property from another instance.voidClear all annotation properties.Return the class loader to use when loading related classes.getOwner()Annotations are stored in anAnnotationstable or as part of anAnnotationproperty value.getPool()Return the constant pool of the current class.Return the project of the current class.All declared properties.getProperty(String name) Return the property with the given name, or null if none.getType()TheClassobject for this annotation's type.The bytecode for the type of this annotation.intThe index in the classConstantPoolof theUTF8Entryholding the type of this annotation.The name of this annotation's type.booleanisValid()Return false if this entity has been removed from its parent; in this case the results of any operations on the entity are undefined.booleanremoveProperty(String name) Remove the property with the given name.booleanRemove the given property.voidsetProperties(Annotation.Property[] props) Set the annotation properties.voidThis annotation's type.voidThis annotation's type.voidThis annotation's type.voidsetTypeIndex(int index) The index in the classConstantPoolof theUTF8Entryholding the type of this annotation.
-
Method Details
-
getOwner
Annotations are stored in anAnnotationstable or as part of anAnnotationproperty value. -
getTypeIndex
public int getTypeIndex()The index in the classConstantPoolof theUTF8Entryholding the type of this annotation. -
setTypeIndex
public void setTypeIndex(int index) The index in the classConstantPoolof theUTF8Entryholding the type of this annotation. -
getTypeName
The name of this annotation's type. -
getType
TheClassobject for this annotation's type. -
getTypeBC
The bytecode for the type of this annotation. -
setType
This annotation's type. -
setType
This annotation's type. -
setType
This annotation's type. -
getProperties
All declared properties. -
setProperties
Set the annotation properties. This method is useful when importing properties from another instance. -
getProperty
Return the property with the given name, or null if none. -
addProperty
Import a property from another instance.- Returns:
- the newly added property
-
addProperty
Add a new property. -
clearProperties
public void clearProperties()Clear all annotation properties. -
removeProperty
Remove the given property.- Returns:
- true if an property was removed, false otherwise
-
removeProperty
Remove the property with the given name.- Returns:
- true if a property was removed, false otherwise
-
getProject
Description copied from interface:BCEntityReturn the project of the current class.- Specified by:
getProjectin interfaceBCEntity
-
getPool
Description copied from interface:BCEntityReturn the constant pool of the current class. -
getClassLoader
Description copied from interface:BCEntityReturn the class loader to use when loading related classes.- Specified by:
getClassLoaderin interfaceBCEntity
-
isValid
public boolean isValid()Description copied from interface:BCEntityReturn false if this entity has been removed from its parent; in this case the results of any operations on the entity are undefined. -
acceptVisit
Description copied from interface:VisitAcceptorAccept a visit from aBCVisitor, 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.- Specified by:
acceptVisitin interfaceVisitAcceptor
-