Top Description Fields Constructors Methods
org.apache.bcel.classfile

public final Class Unknown

extends Attribute
Class Inheritance
Imports
java.io.DataInput, .DataOutputStream, .IOException, java.util.Arrays, org.apache.bcel.Const

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
Attribute, UnknownAttributeReader

Field Summary

Modifier and TypeField and Description
private byte[]
private final String
Inherited from org.apache.bcel.classfile.Attribute:
constant_poolEMPTY_ARRAYlengthname_indextag

Constructor Summary

AccessConstructor and Description
public
Unknown(final int
Index in constant pool
nameIndex
,
final int
Content length in bytes
length
,
final byte[]
Attribute contents
bytes
,
final ConstantPool
Array of constants
constantPool
)

Constructs a new instance for a non-standard attribute.

pack-priv
Unknown(final int
Index in constant pool
nameIndex
,
final int
Content length in bytes
length
,
final DataInput
Input stream
input
,
final ConstantPool
Array of constants
constantPool
)

Constructs a new instance from an input stream.

public
Unknown(final Unknown
Source.
unknown
)

Constructs a new instance from another instance.

Method Summary

Modifier and TypeMethod and Description
public void
accept(final Visitor
Visitor object
v
)

Implements abstract org.apache.bcel.classfile.Attribute.accept.

Implements org.apache.bcel.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.
public Attribute

Returns:

deep copy of this attribute
copy
(final ConstantPool
constant pool to save.
constantPool
)

Implements abstract org.apache.bcel.classfile.Attribute.copy.

public void
dump(final DataOutputStream
Output file stream
file
)

Overrides org.apache.bcel.classfile.Attribute.dump.

Dumps unknown bytes to file stream.
public byte[]

Returns:

data bytes.
getBytes
()

public String

Returns:

name of attribute.
getName
()

Overrides org.apache.bcel.classfile.Attribute.getName.

public void
setBytes(final byte[]
the bytes to set
bytes
)

public String

Returns:

String representation.
toString
()

Overrides org.apache.bcel.classfile.Attribute.toString.

Returns a string representation of the object.
Inherited from org.apache.bcel.classfile.Attribute:
addAttributeReaderaddAttributeReaderclonegetConstantPoolgetLengthgetNameIndexgetTagprintlnreadAttributereadAttributeremoveAttributeReadersetConstantPoolsetLengthsetNameIndex

Field Detail

bytesback to summary
private byte[] bytes
nameback to summary
private final String name

Constructor Detail

Unknownback to summary
public Unknown(final int nameIndex, final int length, final byte[] bytes, final ConstantPool constantPool)

Constructs a new instance for a non-standard attribute.

Parameters
nameIndex:int

Index in constant pool

length:int

Content length in bytes

bytes:byte[]

Attribute contents

constantPool:ConstantPool

Array of constants

Unknownback to summary
pack-priv Unknown(final int nameIndex, final int length, final DataInput input, final ConstantPool constantPool) throws IOException

Constructs a new instance from an input stream.

Parameters
nameIndex:int

Index in constant pool

length:int

Content length in bytes

input:DataInput

Input stream

constantPool:ConstantPool

Array of constants

Exceptions
IOException:
if an I/O error occurs.
Unknownback to summary
public Unknown(final Unknown unknown)

Constructs a new instance from another instance. Note that both objects use the same references (shallow copy). Use clone() for a physical copy.

Parameters
unknown:Unknown

Source.

Method Detail

acceptback to summary
public void accept(final Visitor v)

Implements abstract org.apache.bcel.classfile.Attribute.accept.

Implements org.apache.bcel.classfile.Node.accept.

Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.

Parameters
v:Visitor

Visitor object

Annotations
@Override
copyback to summary
public Attribute copy(final ConstantPool constantPool)

Implements abstract org.apache.bcel.classfile.Attribute.copy.

Parameters
constantPool:ConstantPool

Doc from org.apache.bcel.classfile.Attribute.copy.

constant pool to save.

Returns:Attribute

deep copy of this attribute

Annotations
@Override
dumpback to summary
public void dump(final DataOutputStream file) throws IOException

Overrides org.apache.bcel.classfile.Attribute.dump.

Dumps unknown bytes to file stream.

Parameters
file:DataOutputStream

Output file stream

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
getBytesback to summary
public byte[] getBytes()
Returns:byte[]

data bytes.

getNameback to summary
public String getName()

Overrides org.apache.bcel.classfile.Attribute.getName.

Returns:String

name of attribute.

Annotations
@Override
setBytesback to summary
public void setBytes(final byte[] bytes)
Parameters
bytes:byte[]

the bytes to set

toStringback to summary
public String toString()

Overrides org.apache.bcel.classfile.Attribute.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

String representation.

Annotations
@Override