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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classAnnotation.Property.ValueProperty value struct.
-
Field Summary
Fields Modifier and Type Field Description private int_nameIndexprivate Annotation_ownerprivate Annotation.Property.Value_valueprivate Annotation.Property.Value[]_values
-
Constructor Summary
Constructors Constructor Description Property(Annotation owner)
-
Method Summary
All Methods Static 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.private static java.lang.StringgetEnumName(java.lang.Object o)Return the name of this enum value, or null if not an enum.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.(package private) intgetLength()private intgetLength(Annotation.Property.Value val)Return the length of the given value.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.private java.lang.ObjectgetValue(Annotation.Property.Value val)Extract the Java value.(package private) voidinvalidate()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.(package private) voidread(java.io.DataInput in)private voidread(Annotation.Property.Value val, int tag, java.io.DataInput in)Read data into the given value.voidsetClassNameValue(java.lang.String value)Set the class value of this property.private voidsetClassNameValue(Annotation.Property.Value val, java.lang.String o)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.private voidsetValue(Annotation.Property.Value val, boolean o)Set the boolean value of this property.private voidsetValue(Annotation.Property.Value val, byte o)Set the byte value of this property.private voidsetValue(Annotation.Property.Value val, double o)Set the double value of this property.private voidsetValue(Annotation.Property.Value val, float o)Set the float value of this property.private voidsetValue(Annotation.Property.Value val, int o)Set the int value of this property.private voidsetValue(Annotation.Property.Value val, long o)Set the long value of this property.private voidsetValue(Annotation.Property.Value val, short o)Set the short value of this property.private voidsetValue(Annotation.Property.Value val, java.lang.Object o)Set the given value.private voidsetValue(Annotation.Property.Value val, java.lang.String o)Set the string value of this property.private AnnotationsetValue(Annotation.Property.Value val, Annotation o)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.(package private) voidwrite(java.io.DataOutput out)private voidwrite(Annotation.Property.Value val, java.io.DataOutput out)Write the data for the given value to the stream.
-
-
-
Field Detail
-
_owner
private Annotation _owner
-
_nameIndex
private int _nameIndex
-
_value
private final Annotation.Property.Value _value
-
_values
private Annotation.Property.Value[] _values
-
-
Constructor Detail
-
Property
Property(Annotation owner)
-
-
Method Detail
-
getAnnotation
public Annotation getAnnotation()
The owning annotation.
-
invalidate
void invalidate()
-
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.
-
getValue
private java.lang.Object getValue(Annotation.Property.Value val)
Extract the Java value.
-
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.
-
setValue
private void setValue(Annotation.Property.Value val, java.lang.Object o)
Set the given value.
-
getEnumName
private static java.lang.String getEnumName(java.lang.Object o)
Return the name of this enum value, or null if not an enum.
-
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
private void setValue(Annotation.Property.Value val, java.lang.String o)
Set the string value of this property.
-
setValue
public void setValue(boolean value)
Set the boolean value of this property.
-
setValue
private void setValue(Annotation.Property.Value val, boolean o)
Set the boolean value of this property.
-
setValue
public void setValue(byte value)
Set the byte value of this property.
-
setValue
private void setValue(Annotation.Property.Value val, byte o)
Set the byte value of this property.
-
setValue
public void setValue(int value)
Set the int value of this property.
-
setValue
private void setValue(Annotation.Property.Value val, int o)
Set the int value of this property.
-
setValue
public void setValue(long value)
Set the long value of this property.
-
setValue
private void setValue(Annotation.Property.Value val, long o)
Set the long value of this property.
-
setValue
public void setValue(float value)
Set the float value of this property.
-
setValue
private void setValue(Annotation.Property.Value val, float o)
Set the float value of this property.
-
setValue
public void setValue(double value)
Set the double value of this property.
-
setValue
private void setValue(Annotation.Property.Value val, double o)
Set the double value of this property.
-
setValue
public void setValue(short value)
Set the short value of this property.
-
setValue
private void setValue(Annotation.Property.Value val, short o)
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.
-
setClassNameValue
private void setClassNameValue(Annotation.Property.Value val, java.lang.String o)
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
private Annotation setValue(Annotation.Property.Value val, Annotation o)
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
-
getLength
int getLength()
-
getLength
private int getLength(Annotation.Property.Value val)
Return the length of the given value.
-
read
void read(java.io.DataInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
read
private void read(Annotation.Property.Value val, int tag, java.io.DataInput in) throws java.io.IOException
Read data into the given value.- Throws:
java.io.IOException
-
write
void write(java.io.DataOutput out) throws java.io.IOException- Throws:
java.io.IOException
-
write
private void write(Annotation.Property.Value val, java.io.DataOutput out) throws java.io.IOException
Write the data for the given value to the stream.- Throws:
java.io.IOException
-
-