|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.cunit.classFile.attributes.AAttributeInfo
edu.rice.cs.cunit.classFile.attributes.CodeAttributeInfo
public class CodeAttributeInfo
Represents the Code attribute in a class file.
| Nested Class Summary | |
|---|---|
static class |
CodeAttributeInfo.CodeProperties
Storage class for code properties. |
static class |
CodeAttributeInfo.ExceptionTableEntry
|
| Field Summary | |
|---|---|
protected CodeAttributeInfo.CodeProperties |
_props
Properties read out from _data field. |
| Fields inherited from class edu.rice.cs.cunit.classFile.attributes.AAttributeInfo |
|---|
_constantPool, _data, _name |
| Constructor Summary | |
|---|---|
CodeAttributeInfo(AUTFPoolInfo name,
byte[] data,
ConstantPool cp)
Constructor. |
|
CodeAttributeInfo(AUTFPoolInfo name,
int maxStack,
int maxLocals,
byte[] code,
CodeAttributeInfo.ExceptionTableEntry[] exceptionTableEntries,
AAttributeInfo[] attributes,
ConstantPool cp)
Constructor. |
|
| 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. |
|
|
execute(IAttributeVisitor<R,D> visitor,
D param)
Execute a visitor on this attribute. |
|
static java.lang.String |
getAttributeName()
Returns the name of the attribute as it appears in the class file. |
|
AAttributeInfo[] |
getAttributes()
Return a copy of the attributes. |
|
byte[] |
getCode()
Return a copy of the code bytes. |
|
CodeAttributeInfo.ExceptionTableEntry[] |
getExceptionTableEntries()
Return a copy of the exception table entries. |
|
CodeAttributeInfo.CodeProperties |
getProperties()
Return a copy of the code properties. |
|
void |
setAttributes(AAttributeInfo[] a)
Sets the attribute list. |
|
void |
setCode(byte[] code)
Set the code bytes. |
|
void |
setData(byte[] data)
Mutator for data. |
|
void |
setExceptionTableEntries(CodeAttributeInfo.ExceptionTableEntry[] e)
Set the exception table entries. |
|
void |
setProperties(int maxStack,
int maxLocals)
Set the code properties. |
|
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, getData, getName, hashCode, read, setName, write |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected CodeAttributeInfo.CodeProperties _props
| Constructor Detail |
|---|
public CodeAttributeInfo(AUTFPoolInfo name,
byte[] data,
ConstantPool cp)
throws java.lang.ClassFormatError
name - attribute namedata - attribute datacp - constant pool
java.lang.ClassFormatError
public CodeAttributeInfo(AUTFPoolInfo name,
int maxStack,
int maxLocals,
byte[] code,
CodeAttributeInfo.ExceptionTableEntry[] exceptionTableEntries,
AAttributeInfo[] attributes,
ConstantPool cp)
throws java.lang.ClassFormatError,
java.io.IOException
name - attribute name, must be a UTF item "Code"maxStack - maximum state sizemaxLocals - maximum number of localscode - bytecodeexceptionTableEntries - exception table entriesattributes - attributescp - constant pool
java.lang.ClassFormatError
java.io.IOException| Method Detail |
|---|
public void setData(byte[] data)
setData in class AAttributeInfodata - data
public CodeAttributeInfo.CodeProperties getProperties()
throws java.lang.ClassFormatError
java.lang.ClassFormatError
public void setProperties(int maxStack,
int maxLocals)
maxStack - new maximum statemaxLocals - new maximum locals
java.lang.ClassFormatErrorpublic byte[] getCode()
public void setCode(byte[] code)
throws java.lang.IllegalArgumentException
code - new code bytes
java.lang.IllegalArgumentExceptionpublic CodeAttributeInfo.ExceptionTableEntry[] getExceptionTableEntries()
public void setExceptionTableEntries(CodeAttributeInfo.ExceptionTableEntry[] e)
throws java.lang.IllegalArgumentException
e - entries
java.lang.IllegalArgumentException
public AAttributeInfo[] getAttributes()
throws java.lang.ClassFormatError
java.lang.ClassFormatError
public void setAttributes(AAttributeInfo[] a)
throws java.lang.ClassFormatError,
java.lang.IllegalArgumentException
a - attributes
java.lang.ClassFormatError
java.lang.IllegalArgumentException
public <R,D> R execute(IAttributeVisitor<R,D> visitor,
D param)
execute in class AAttributeInfovisitor - visitorparam - visitor-specific parameter
public java.lang.String toString()
toString in class AAttributeInfo
public void adjustPC(int startPC,
int deltaPC)
adjustPC in class AAttributeInfostartPC - program counter to start atdeltaPC - change in program counter values
public void translatePC(int index,
int deltaIndex,
LineNumberTable oldLnt,
LineNumberTable newLnt)
translatePC in class AAttributeInfoindex - critical point (insertion or deletion point)deltaIndex - delta value to add to all old line numbers greater than the critical pointoldLnt - old line number tablenewLnt - new line number table
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class AAttributeInfojava.lang.CloneNotSupportedExceptionpublic static java.lang.String getAttributeName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||