soot.tagkit
Class CodeAttribute

java.lang.Object
  extended by soot.tagkit.JasminAttribute
      extended by soot.tagkit.CodeAttribute
All Implemented Interfaces:
Attribute, Tag

public class CodeAttribute
extends JasminAttribute

A CodeAttribute object holds PC -> Tag pairs. It represents abstracted attributes of Code_attribute such as LineNumberTable, ArrayBoundsCheck.


Field Summary
protected  List<Tag> mTags
           
protected  List<Unit> mUnits
           
 
Constructor Summary
CodeAttribute()
           
CodeAttribute(String name)
          Creates an attribute object with the given name.
CodeAttribute(String name, List<Unit> units, List<Tag> tags)
          Create an attribute object with the name and lists of unit-tag pairs.
 
Method Summary
 byte[] decode(String attr, Hashtable labelToPc)
           
 String getJasminValue(Map instToLabel)
          Generates Jasmin Value String
 String getName()
          Returns the attribute name.
 List<UnitBox> getUnitBoxes()
          Returns a list of unit boxes that have tags attached.
 byte[] getValue()
          Also only used as setValue().
 void setValue(byte[] v)
          Only used by SOOT to read in an existing attribute without interpret it.
 String toString()
          Returns the name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mUnits

protected List<Unit> mUnits

mTags

protected List<Tag> mTags
Constructor Detail

CodeAttribute

public CodeAttribute()

CodeAttribute

public CodeAttribute(String name)
Creates an attribute object with the given name.


CodeAttribute

public CodeAttribute(String name,
                     List<Unit> units,
                     List<Tag> tags)
Create an attribute object with the name and lists of unit-tag pairs.

Method Detail

toString

public String toString()
Returns the name.

Overrides:
toString in class Object

getName

public String getName()
Returns the attribute name.


setValue

public void setValue(byte[] v)
Only used by SOOT to read in an existing attribute without interpret it.


getValue

public byte[] getValue()
                throws AttributeValueException
Also only used as setValue().

Throws:
AttributeValueException

getJasminValue

public String getJasminValue(Map instToLabel)
Generates Jasmin Value String

Specified by:
getJasminValue in class JasminAttribute

getUnitBoxes

public List<UnitBox> getUnitBoxes()
Returns a list of unit boxes that have tags attached.


decode

public byte[] decode(String attr,
                     Hashtable labelToPc)
Specified by:
decode in class JasminAttribute