public class CodeAttr extends Attribute
Opcode
,
CodeBuilder
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, STACK_MAP_TABLE, SYNTHETIC
Constructor and Description |
---|
CodeAttr(ConstantPool cp) |
CodeAttr(ConstantPool cp,
String name) |
CodeAttr(ConstantPool cp,
String name,
int length,
DataInput din,
AttributeFactory attrFactory) |
Modifier and Type | Method and Description |
---|---|
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).
|
LocalVariable |
getLocalVariable(int useLocation,
int number)
Returns local variable info at the given location, for the given number.
|
LocalVariable |
getLocalVariable(Location useLocation,
int number)
Returns local variable info at the given location, for the given number.
|
StackMapTableAttr |
getStackMapTable() |
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 |
setInitialStackMapFrame(MethodInfo method) |
void |
writeDataTo(DataOutput dout)
Write just the attribute specific data.
|
getConstantPool, getName, getNameConstant, readFrom, skipBytes, writeTo
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
public CodeBuffer getCodeBuffer()
public void setCodeBuffer(CodeBuffer code)
public int getLineNumber(Location start)
public LocalVariable getLocalVariable(Location useLocation, int number)
public LocalVariable getLocalVariable(int useLocation, int number)
public void mapLineNumber(Location start, int line_number)
public void localVariableUse(LocalVariable localVar)
public StackMapTableAttr getStackMapTable()
public void setInitialStackMapFrame(MethodInfo method)
public void addAttribute(Attribute attr)
public Attribute[] getAttributes()
Attribute
getAttributes
in class Attribute
public int getLength()
public void writeDataTo(DataOutput dout) throws IOException
Attribute
writeDataTo
in class Attribute
IOException
Copyright © 2004-2015 Cojen. All Rights Reserved.