Package serp.bytecode
Class Annotation.Property
- java.lang.Object
-
- serp.bytecode.Annotation.Property
-
- All Implemented Interfaces:
BCEntity,VisitAcceptor
- Enclosing class:
- Annotation
public static class Annotation.Property extends java.lang.Object implements BCEntity, VisitAcceptor
An annotation property.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceptVisit(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.AnnotationgetAnnotation()The owning annotation.AnnotationgetAnnotationValue()Return the annotation value of this property, or null if not set.booleangetBooleanValue()Return the boolean value of this property, or false if not set.bytegetByteValue()Return the byte value of this property, or false if not set.java.lang.ClassLoadergetClassLoader()Return the class loader to use when loading related classes.java.lang.StringgetClassNameValue()Return the class value of this property, or null if not set.doublegetDoubleValue()Return the double value of this property, or 0 if not set.floatgetFloatValue()Return the float value of this property, or 0 if not set.intgetIntValue()Return the int value of this property, or 0 if not set.longgetLongValue()Return the long value of this property, or 0 if not set.java.lang.StringgetName()Return the name of this property.intgetNameIndex()Return the index in the classConstantPoolof theUTF8Entryholding the name of this property.ConstantPoolgetPool()Return the constant pool of the current class.ProjectgetProject()Return the project of the current class.shortgetShortValue()Return the short value of this property, or 0 if not set.java.lang.StringgetStringValue()Return the string value of this property, or null if not set.java.lang.ObjectgetValue()Return the value of the property as its wrapper 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.Annotation[]newAnnotationArrayValue(java.lang.Class type, int length)Set this property value to a new annotation array of the given type and length, returning the annotations for manipulation.Annotation[]newAnnotationArrayValue(java.lang.String type, int length)Set this property value to a new annotation array of the given type and length, returning the annotations for manipulation.Annotation[]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.AnnotationnewAnnotationValue(java.lang.Class type)Set this property value to a new annotation of the given type, returning the annotation for manipulation.AnnotationnewAnnotationValue(java.lang.String type)Set this property value to a new annotation of the given type, returning the annotation for manipulation.AnnotationnewAnnotationValue(BCClass type)Set this property value to a new annotation of the given type, returning the annotation for manipulation.voidsetClassNameValue(java.lang.String value)Set the class value of this property.voidsetName(java.lang.String name)Set the name of this property.voidsetNameIndex(int index)Set the index in the classConstantPoolof theUTF8Entryholding the name of this property.voidsetValue(boolean value)Set the boolean value of this property.voidsetValue(byte value)Set the byte value of this property.voidsetValue(double value)Set the double value of this property.voidsetValue(float value)Set the float value of this property.voidsetValue(int value)Set the int value of this property.voidsetValue(long value)Set the long value of this property.voidsetValue(short value)Set the short value of this property.voidsetValue(java.lang.Class value)Set the class value of this property.voidsetValue(java.lang.Object value)Set value of this property.voidsetValue(java.lang.String value)Set the string value of this property.AnnotationsetValue(Annotation value)Set the annotation value of this property by importing the given annotation from another instance.Annotation[]setValue(Annotation[] value)Set the annotation value of this property by importing the given annotation from another instance.voidsetValue(BCClass value)Set the class value of this property.
-
-
-
Method Detail
-
getAnnotation
public Annotation getAnnotation()
The owning annotation.
-
getNameIndex
public int getNameIndex()
Return the index in the classConstantPoolof theUTF8Entryholding the name of this property.
-
setNameIndex
public void setNameIndex(int index)
Set the index in the classConstantPoolof theUTF8Entryholding the name of this property.
-
getName
public java.lang.String getName()
Return the name of this property.
-
setName
public void setName(java.lang.String name)
Set the name of this property.
-
getValue
public java.lang.Object getValue()
Return the value of the property as its wrapper type. Returns class values as the class name.
-
setValue
public void setValue(java.lang.Object value)
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
public java.lang.String 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
public java.lang.String getClassNameValue()
Return the class value of this property, or null if not set.
-
getAnnotationValue
public Annotation getAnnotationValue()
Return the annotation value of this property, or null if not set.
-
setValue
public void setValue(java.lang.String value)
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
public void setValue(java.lang.Class value)
Set the class value of this property.
-
setValue
public void setValue(BCClass value)
Set the class value of this property.
-
setClassNameValue
public void setClassNameValue(java.lang.String value)
Set the class value of this property.
-
setValue
public Annotation setValue(Annotation value)
Set the annotation value of this property by importing the given annotation from another instance.
-
setValue
public Annotation[] setValue(Annotation[] value)
Set the annotation value of this property by importing the given annotation from another instance.
-
newAnnotationValue
public Annotation newAnnotationValue(java.lang.Class type)
Set this property value to a new annotation of the given type, returning the annotation for manipulation.
-
newAnnotationValue
public Annotation newAnnotationValue(BCClass type)
Set this property value to a new annotation of the given type, returning the annotation for manipulation.
-
newAnnotationValue
public Annotation newAnnotationValue(java.lang.String type)
Set this property value to a new annotation of the given type, returning the annotation for manipulation.
-
newAnnotationArrayValue
public Annotation[] newAnnotationArrayValue(java.lang.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
public Annotation[] 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.
-
newAnnotationArrayValue
public Annotation[] newAnnotationArrayValue(java.lang.String type, int length)
Set this property value to a new annotation array of the given type and length, returning the annotations for manipulation.
-
getProject
public Project getProject()
Description copied from interface:BCEntityReturn the project of the current class.- Specified by:
getProjectin interfaceBCEntity
-
getPool
public ConstantPool getPool()
Description copied from interface:BCEntityReturn the constant pool of the current class.
-
getClassLoader
public java.lang.ClassLoader 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
public void acceptVisit(BCVisitor visit)
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
-
-