APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.bcel.internal.classfile

public final Class Unknown

extends Attribute
Class Inheritance
Imports
java.io.DataInput, .DataOutputStream, .IOException, java.util.Arrays, com.sun.org.apache.bcel.internal.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 com.sun.org.apache.bcel.internal.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 com.sun.org.apache.bcel.internal.classfile.Attribute.accept.

Implements com.sun.org.apache.bcel.internal.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
copy(final ConstantPool constantPool)

Implements abstract com.sun.org.apache.bcel.internal.classfile.Attribute.copy.

Returns: deep copy of this attribute

public void
dump(final DataOutputStream
Output file stream
file
)

Overrides com.sun.org.apache.bcel.internal.classfile.Attribute.dump.

Dumps unknown bytes to file stream.

public byte[]
getBytes()

Returns: data bytes.

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

public String

Returns:

String representation.
toString
()

Overrides com.sun.org.apache.bcel.internal.classfile.Attribute.toString.

Returns a string representation of the object.

Inherited from com.sun.org.apache.bcel.internal.classfile.Attribute:
addAttributeReaderclonegetConstantPoolgetLengthgetNameIndexgetTagprintlnreadAttributereadAttributeremoveAttributeReadersetConstantPoolsetLengthsetNameIndex

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 com.sun.org.apache.bcel.internal.classfile.Attribute.accept.

Implements com.sun.org.apache.bcel.internal.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 com.sun.org.apache.bcel.internal.classfile.Attribute.copy.

Returns:Attribute

deep copy of this attribute

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

Overrides com.sun.org.apache.bcel.internal.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 com.sun.org.apache.bcel.internal.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 com.sun.org.apache.bcel.internal.classfile.Attribute.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

String representation.

Annotations
@Override