Package org.apache.bcel.classfile
Class Unknown
java.lang.Object
org.apache.bcel.classfile.Attribute
org.apache.bcel.classfile.Unknown
This class represents a reference to an unknown (i.e.,
application-specific) attribute of a class. It is instantiated from the
Attribute.readAttribute(java.io.DataInput, ConstantPool) method.
Applications that need to read in application-specific attributes should create an
UnknownAttributeReader implementation and attach it via
Attribute.addAttributeReader(String, UnknownAttributeReader).- See Also:
-
Field Summary
Fields inherited from class org.apache.bcel.classfile.Attribute
constant_pool, length, name_index, tag -
Constructor Summary
ConstructorsConstructorDescriptionUnknown(int name_index, int length, byte[] bytes, ConstantPool constant_pool) Create a non-standard attribute.Initialize from another object. -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.copy(ConstantPool _constant_pool) voiddump(DataOutputStream file) Dump unknown bytes to file stream.byte[]getBytes()getName()voidsetBytes(byte[] bytes) toString()Methods inherited from class org.apache.bcel.classfile.Attribute
addAttributeReader, addAttributeReader, clone, getConstantPool, getLength, getNameIndex, getTag, println, readAttribute, readAttribute, removeAttributeReader, setConstantPool, setLength, setNameIndex
-
Constructor Details
-
Unknown
Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a physical copy. -
Unknown
Create a non-standard attribute.- Parameters:
name_index- Index in constant poollength- Content length in bytesbytes- Attribute contentsconstant_pool- Array of constants
-
-
Method Details
-
accept
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects. -
dump
Dump unknown bytes to file stream.- Overrides:
dumpin classAttribute- Parameters:
file- Output file stream- Throws:
IOException
-
getBytes
public byte[] getBytes()- Returns:
- data bytes.
-
getName
-
setBytes
public void setBytes(byte[] bytes) - Parameters:
bytes- the bytes to set
-
toString
-
copy
-