edu.rice.cs.cunit.classFile.attributes
Class AMultipleAnnotationsAttributeInfo

java.lang.Object
  extended by edu.rice.cs.cunit.classFile.attributes.AAttributeInfo
      extended by edu.rice.cs.cunit.classFile.attributes.AAnnotationsAttributeInfo
          extended by edu.rice.cs.cunit.classFile.attributes.AMultipleAnnotationsAttributeInfo
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
RuntimeInvisibleParameterAnnotationsAttributeInfo, RuntimeVisibleParameterAnnotationsAttributeInfo

public abstract class AMultipleAnnotationsAttributeInfo
extends AAnnotationsAttributeInfo

Represents an abstract annotations attribute in a class file that can contain annotations for multiple entities, like for method parameters or local variables.

Author:
Mathias Ricken

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.rice.cs.cunit.classFile.attributes.AAnnotationsAttributeInfo
AAnnotationsAttributeInfo.Annotation
 
Field Summary
 
Fields inherited from class edu.rice.cs.cunit.classFile.attributes.AAttributeInfo
_constantPool, _data, _name
 
Constructor Summary
AMultipleAnnotationsAttributeInfo(AUTFPoolInfo name, byte[] data, ConstantPool cp)
          Creates a new abstract multiple annotations attribute.
 
Method Summary
 void adjustPC(int startPC, int deltaPC)
          Adjust program counter values contained in this attribute, starting at startPC, by adding deltaPC to them.
 java.lang.Object clone()
          Creates and returns a copy of this object.
 java.util.List<AAnnotationsAttributeInfo.Annotation[]> getEntityAnnotations()
          Return the list of entity annotations arrays.
 short getEntityCount()
          Return the number of entities.
abstract  java.lang.String getEntityName()
          Return the name of the entity, e.g.
 void setEntityAnnotations(java.util.List<AAnnotationsAttributeInfo.Annotation[]> entityAnnots)
          Set the entity annotations list.
 java.lang.String toString()
          Return a human-readable version of this attribute.
 void translatePC(int index, int deltaIndex, LineNumberTable oldLnt, LineNumberTable newLnt)
          Translate the program counter values contained in this attribute from an old line number table to a new one.
 
Methods inherited from class edu.rice.cs.cunit.classFile.attributes.AAttributeInfo
equals, execute, getData, getName, hashCode, read, setData, setName, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AMultipleAnnotationsAttributeInfo

public AMultipleAnnotationsAttributeInfo(AUTFPoolInfo name,
                                         byte[] data,
                                         ConstantPool cp)
Creates a new abstract multiple annotations attribute.

Parameters:
name - name of attribute
data - data array
cp - constant pool
Method Detail

getEntityCount

public short getEntityCount()
                     throws java.lang.ClassFormatError
Return the number of entities.

Returns:
number of entities
Throws:
java.lang.ClassFormatError

getEntityAnnotations

public java.util.List<AAnnotationsAttributeInfo.Annotation[]> getEntityAnnotations()
                                                                            throws java.lang.ClassFormatError
Return the list of entity annotations arrays.

Returns:
list of arrays of entity annotations.
Throws:
java.lang.ClassFormatError

setEntityAnnotations

public void setEntityAnnotations(java.util.List<AAnnotationsAttributeInfo.Annotation[]> entityAnnots)
                          throws java.io.IOException
Set the entity annotations list.

Parameters:
entityAnnots - list of arrays of entity anotations
Throws:
java.lang.ClassFormatError
java.io.IOException

toString

public java.lang.String toString()
Return a human-readable version of this attribute.

Overrides:
toString in class AAttributeInfo
Returns:
string

getEntityName

public abstract java.lang.String getEntityName()
Return the name of the entity, e.g. "parameter" or "local variable".

Returns:
name of tne entity

adjustPC

public void adjustPC(int startPC,
                     int deltaPC)
Adjust program counter values contained in this attribute, starting at startPC, by adding deltaPC to them.

Overrides:
adjustPC in class AAnnotationsAttributeInfo
Parameters:
startPC - program counter to start at
deltaPC - change in program counter values

translatePC

public void translatePC(int index,
                        int deltaIndex,
                        LineNumberTable oldLnt,
                        LineNumberTable newLnt)
Translate the program counter values contained in this attribute from an old line number table to a new one.

Overrides:
translatePC in class AAnnotationsAttributeInfo
Parameters:
index - critical point (insertion or deletion point)
deltaIndex - delta value to add to all old line numbers greater than the critical point
oldLnt - old line number table
newLnt - new line number table

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

Overrides:
clone in class AAnnotationsAttributeInfo
Throws:
java.lang.CloneNotSupportedException