|
TechTrader Bytecode Toolkit | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.techtrader.modules.tools.bytecode.BCEntity | +--com.techtrader.modules.tools.bytecode.Attribute
Representation of an attribute in a .class file. Attributes are used to represent constants and the code of methods, among other things. All attributes contain at a minimum a name, which is immutable, as it determines the attribute's type.
Field Summary | |
protected int |
_nameIndex
|
protected BCEntity |
_owner
|
Constructor Summary | |
protected |
Attribute(int nameIndex,
BCEntity owner)
Protected Constructor. |
Method Summary | |
protected void |
copy(Attribute other)
Copy the information from the given attribute to this one. |
protected static Attribute |
createAttribute(String name,
BCEntity owner)
Create an attribute of the appropriate type based on the the attribute name. |
int |
getLength()
Return the length of the .class representation of this attribute, in bytes. |
String |
getName()
Return the name of this attribute. |
int |
getNameIndex()
Return the constant pool index of the UTF entry holding the name of this attribute. |
BCEntity |
getOwner()
Each Attribute references the entity that owns it. |
ConstantPool |
getPool()
Implementation of the BCEntity abstract method; delegates to the owning entity. |
protected void |
invalidate()
Invalidate this Attribute. |
protected void |
readData(DataInput in,
int length)
Should be overridden by subclasses to read their internal data from the given stream, up to length bytes, excluding the name index. |
protected void |
writeData(DataOutput out,
int length)
Should be overridden by subclasses to write their internal data to the given stream, up to length bytes, excluding the name index. |
Methods inherited from class com.techtrader.modules.tools.bytecode.BCEntity |
addAttribute,
clearAttributes,
getAttribute,
getAttributes,
getAttributes,
importAttribute,
importAttributes,
readAttributes,
removeAttribute,
removeAttribute,
visitAttributes,
writeAttributes |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected int _nameIndex
protected BCEntity _owner
Constructor Detail |
protected Attribute(int nameIndex, BCEntity owner)
Method Detail |
protected static Attribute createAttribute(String name, BCEntity owner)
protected void invalidate()
public BCEntity getOwner()
public int getNameIndex()
public String getName()
public ConstantPool getPool()
public int getLength()
protected void copy(Attribute other)
protected void readData(DataInput in, int length) throws IOException
protected void writeData(DataOutput out, int length) throws IOException
|
TechTrader Bytecode Toolkit | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |