|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cojen.classfile.Attribute
org.cojen.classfile.attribute.CodeAttr
public class CodeAttr
This class corresponds to the Code_attribute structure as defined in section 4.7.4 of The Java Virtual Machine Specification. To make it easier to create bytecode for the CodeAttr, use the CodeBuilder.
cojen.classfile.Opcode
,
cojen.classfile.CodeBuilder
Field Summary |
---|
Fields inherited from class org.cojen.classfile.Attribute |
---|
CODE, CONSTANT_VALUE, DEPRECATED, ENCLOSING_METHOD, EXCEPTIONS, INNER_CLASSES, LINE_NUMBER_TABLE, LOCAL_VARIABLE_TABLE, RUNTIME_INVISIBLE_ANNOTATIONS, RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS, RUNTIME_VISIBLE_ANNOTATIONS, RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS, SIGNATURE, SOURCE_FILE, SYNTHETIC |
Constructor Summary | |
---|---|
CodeAttr(ConstantPool cp)
|
|
CodeAttr(ConstantPool cp,
String name)
|
|
CodeAttr(ConstantPool cp,
String name,
int length,
DataInput din,
AttributeFactory attrFactory)
|
Method Summary | |
---|---|
void |
addAttribute(Attribute attr)
|
Attribute[] |
getAttributes()
Some attributes have sub-attributes. |
CodeBuffer |
getCodeBuffer()
Returns null if no CodeBuffer is defined for this CodeAttr. |
int |
getLength()
Returns the length (in bytes) of this object in the class file. |
int |
getLineNumber(Location start)
Returns the line number in the source code from the given bytecode address (start_pc). |
void |
localVariableUse(LocalVariable localVar)
Indicate a local variable's use information be recorded in the ClassFile as a debugging aid. |
void |
mapLineNumber(Location start,
int line_number)
Map a bytecode address (start_pc) to a line number in the source code as a debugging aid. |
void |
setCodeBuffer(CodeBuffer code)
As a side effect of calling this method, new line number and local variable tables are created. |
void |
writeDataTo(DataOutput dout)
Write just the attribute specific data. |
Methods inherited from class org.cojen.classfile.Attribute |
---|
getConstantPool, getName, getNameConstant, readFrom, writeTo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CodeAttr(ConstantPool cp)
public CodeAttr(ConstantPool cp, String name)
public CodeAttr(ConstantPool cp, String name, int length, DataInput din, AttributeFactory attrFactory) throws IOException
IOException
Method Detail |
---|
public CodeBuffer getCodeBuffer()
public void setCodeBuffer(CodeBuffer code)
public int getLineNumber(Location start)
public void mapLineNumber(Location start, int line_number)
public void localVariableUse(LocalVariable localVar)
public void addAttribute(Attribute attr)
public Attribute[] getAttributes()
Attribute
getAttributes
in class Attribute
public int getLength()
getLength
in class Attribute
public void writeDataTo(DataOutput dout) throws IOException
Attribute
writeDataTo
in class Attribute
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |