Package serp.bytecode
Class Annotation.Property
java.lang.Object
serp.bytecode.Annotation.Property
- All Implemented Interfaces:
BCEntity
,VisitAcceptor
- Enclosing class:
Annotation
An annotation property.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
acceptVisit
(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.The owning annotation.Return the annotation value of this property, or null if not set.boolean
Return the boolean value of this property, or false if not set.byte
Return the byte value of this property, or false if not set.Return the class loader to use when loading related classes.Return the class value of this property, or null if not set.double
Return the double value of this property, or 0 if not set.float
Return the float value of this property, or 0 if not set.int
Return the int value of this property, or 0 if not set.long
Return the long value of this property, or 0 if not set.getName()
Return the name of this property.int
Return the index in the classConstantPool
of theUTF8Entry
holding the name of this property.getPool()
Return the constant pool of the current class.Return the project of the current class.short
Return the short value of this property, or 0 if not set.Return the string value of this property, or null if not set.getValue()
Return the value of the property as its wrapper 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.newAnnotationArrayValue
(Class type, int length) Set this property value to a new annotation array of the given type and length, returning the annotations for manipulation.newAnnotationArrayValue
(String type, int length) Set this property value to a new annotation array of the given type and length, returning the annotations for manipulation.newAnnotationArrayValue
(BCClass type, int length) Set this property value to a new annotation array of the given type and length, returning the annotations for manipulation.newAnnotationValue
(Class type) Set this property value to a new annotation of the given type, returning the annotation for manipulation.newAnnotationValue
(String type) Set this property value to a new annotation of the given type, returning the annotation for manipulation.newAnnotationValue
(BCClass type) Set this property value to a new annotation of the given type, returning the annotation for manipulation.void
setClassNameValue
(String value) Set the class value of this property.void
Set the name of this property.void
setNameIndex
(int index) Set the index in the classConstantPool
of theUTF8Entry
holding the name of this property.void
setValue
(boolean value) Set the boolean value of this property.void
setValue
(byte value) Set the byte value of this property.void
setValue
(double value) Set the double value of this property.void
setValue
(float value) Set the float value of this property.void
setValue
(int value) Set the int value of this property.void
setValue
(long value) Set the long value of this property.void
setValue
(short value) Set the short value of this property.void
Set the class value of this property.void
Set value of this property.void
Set the string value of this property.setValue
(Annotation value) Set the annotation value of this property by importing the given annotation from another instance.setValue
(Annotation[] value) Set the annotation value of this property by importing the given annotation from another instance.void
Set the class value of this property.
-
Method Details
-
getAnnotation
The owning annotation. -
getNameIndex
public int getNameIndex()Return the index in the classConstantPool
of theUTF8Entry
holding the name of this property. -
setNameIndex
public void setNameIndex(int index) Set the index in the classConstantPool
of theUTF8Entry
holding the name of this property. -
getName
Return the name of this property. -
setName
Set the name of this property. -
getValue
Return the value of the property as its wrapper type. Returns class values as the class name. -
setValue
Set value of this property. The value should be an instance of any primitive wrapper type, String, Class, BCClass, an enum constant, an annotation, or an array of any of these types. -
getStringValue
Return the string value of this property, or null if not set. -
getBooleanValue
public boolean getBooleanValue()Return the boolean value of this property, or false if not set. -
getByteValue
public byte getByteValue()Return the byte value of this property, or false if not set. -
getIntValue
public int getIntValue()Return the int value of this property, or 0 if not set. -
getLongValue
public long getLongValue()Return the long value of this property, or 0 if not set. -
getFloatValue
public float getFloatValue()Return the float value of this property, or 0 if not set. -
getDoubleValue
public double getDoubleValue()Return the double value of this property, or 0 if not set. -
getShortValue
public short getShortValue()Return the short value of this property, or 0 if not set. -
getClassNameValue
Return the class value of this property, or null if not set. -
getAnnotationValue
Return the annotation value of this property, or null if not set. -
setValue
Set the string value of this property. -
setValue
public void setValue(boolean value) Set the boolean value of this property. -
setValue
public void setValue(byte value) Set the byte value of this property. -
setValue
public void setValue(int value) Set the int value of this property. -
setValue
public void setValue(long value) Set the long value of this property. -
setValue
public void setValue(float value) Set the float value of this property. -
setValue
public void setValue(double value) Set the double value of this property. -
setValue
public void setValue(short value) Set the short value of this property. -
setValue
Set the class value of this property. -
setValue
Set the class value of this property. -
setClassNameValue
Set the class value of this property. -
setValue
Set the annotation value of this property by importing the given annotation from another instance. -
setValue
Set the annotation value of this property by importing the given annotation from another instance. -
newAnnotationValue
Set this property value to a new annotation of the given type, returning the annotation for manipulation. -
newAnnotationValue
Set this property value to a new annotation of the given type, returning the annotation for manipulation. -
newAnnotationValue
Set this property value to a new annotation of the given type, returning the annotation for manipulation. -
newAnnotationArrayValue
Set this property value to a new annotation array of the given type and length, returning the annotations for manipulation. -
newAnnotationArrayValue
Set this property value to a new annotation array of the given type and length, returning the annotations for manipulation. -
newAnnotationArrayValue
Set this property value to a new annotation array of the given type and length, returning the annotations for manipulation. -
getProject
Description copied from interface:BCEntity
Return the project of the current class.- Specified by:
getProject
in interfaceBCEntity
-
getPool
Description copied from interface:BCEntity
Return the constant pool of the current class. -
getClassLoader
Description copied from interface:BCEntity
Return the class loader to use when loading related classes.- Specified by:
getClassLoader
in interfaceBCEntity
-
isValid
public boolean isValid()Description copied from interface:BCEntity
Return 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:VisitAcceptor
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.- Specified by:
acceptVisit
in interfaceVisitAcceptor
-