serp.bytecode
Class Annotation.Property

java.lang.Object
  extended by serp.bytecode.Annotation.Property
All Implemented Interfaces:
BCEntity, VisitAcceptor
Enclosing class:
Annotation

public static class Annotation.Property
extends Object
implements BCEntity, VisitAcceptor

An annotation property.


Method Summary
 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 getAnnotation()
          The owning annotation.
 Annotation getAnnotationValue()
          Return the annotation value of this property, or null if not set.
 boolean getBooleanValue()
          Return the boolean value of this property, or false if not set.
 byte getByteValue()
          Return the byte value of this property, or false if not set.
 ClassLoader getClassLoader()
          Return the class loader to use when loading related classes.
 String getClassNameValue()
          Return the class value of this property, or null if not set.
 double getDoubleValue()
          Return the double value of this property, or 0 if not set.
 float getFloatValue()
          Return the float value of this property, or 0 if not set.
 int getIntValue()
          Return the int value of this property, or 0 if not set.
 long getLongValue()
          Return the long value of this property, or 0 if not set.
 String getName()
          Return the name of this property.
 int getNameIndex()
          Return the index in the class ConstantPool of the UTF8Entry holding the name of this property.
 ConstantPool getPool()
          Return the constant pool of the current class.
 Project getProject()
          Return the project of the current class.
 short getShortValue()
          Return the short value of this property, or 0 if not set.
 String getStringValue()
          Return the string value of this property, or null if not set.
 Object 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.
 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.
 Annotation[] 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.
 Annotation[] 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.
 Annotation newAnnotationValue(BCClass type)
          Set this property value to a new annotation of the given type, returning the annotation for manipulation.
 Annotation newAnnotationValue(Class type)
          Set this property value to a new annotation of the given type, returning the annotation for manipulation.
 Annotation newAnnotationValue(String 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 setName(String name)
          Set the name of this property.
 void setNameIndex(int index)
          Set the index in the class ConstantPool of the UTF8Entry holding the name of this property.
 Annotation setValue(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.
 void setValue(BCClass value)
          Set the class value 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(Class value)
          Set the class 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(Object value)
          Set value of this property.
 void setValue(short value)
          Set the short value of this property.
 void setValue(String value)
          Set the string value of this property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAnnotation

public Annotation getAnnotation()
The owning annotation.


getNameIndex

public int getNameIndex()
Return the index in the class ConstantPool of the UTF8Entry holding the name of this property.


setNameIndex

public void setNameIndex(int index)
Set the index in the class ConstantPool of the UTF8Entry holding the name of this property.


getName

public String getName()
Return the name of this property.


setName

public void setName(String name)
Set the name of this property.


getValue

public Object getValue()
Return the value of the property as its wrapper type. Returns class values as the class name.


setValue

public void setValue(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 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 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(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(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(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(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(String type)
Set this property value to a new annotation of the given type, returning the annotation for manipulation.


newAnnotationArrayValue

public Annotation[] 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

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(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: BCEntity
Return the project of the current class.

Specified by:
getProject in interface BCEntity

getPool

public ConstantPool getPool()
Description copied from interface: BCEntity
Return the constant pool of the current class.

Specified by:
getPool in interface BCEntity

getClassLoader

public ClassLoader getClassLoader()
Description copied from interface: BCEntity
Return the class loader to use when loading related classes.

Specified by:
getClassLoader in interface BCEntity

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.

Specified by:
isValid in interface BCEntity

acceptVisit

public void acceptVisit(BCVisitor visit)
Description copied from interface: VisitAcceptor
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.

Specified by:
acceptVisit in interface VisitAcceptor


Copyright © 2002-2007. All Rights Reserved.