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

public final Class Unknown

extends Attribute
Class Inheritance
Imports
java.io.DataInputStream, .DataOutputStream, .IOException, org.aspectj.apache.bcel.Constants

This class represents a reference to an unknown (i.e., application-specific) attribute of a class. It is instantiated from the Attribute.readAttribute() method. Applications that need to read in application-specific attributes should create an AttributeReader implementation and attach it via Attribute.addAttributeReader.
Author
M. Dahm
Version
$Id: Unknown.java,v 1.6 2009/09/15 19:40:12 aclement Exp $
See Also
org.aspectj.apache.bcel.classfile.Attribute

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
Unknown(Unknown c)

Initialize from another object.

public
Unknown(int
Index in constant pool
name_index
,
int
Content length in bytes
length
,
byte[]
Attribute contents
bytes
,
ConstantPool
Array of constants
constant_pool
)

Create a non-standard attribute.

pack-priv
Unknown(int
Index in constant pool
name_index
,
int
Content length in bytes
length
,
DataInputStream
Input stream
file
,
ConstantPool
Array of constants
constant_pool
)

Construct object from file stream.

Method Summary

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

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

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

Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
public final void
dump(DataOutputStream
Output file stream
file
)

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

Dump unknown bytes to file stream.
public final byte[]

Returns:

data bytes.
getBytes
()

public String

Returns:

name of attribute.
getName
()

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

public final void
setBytes(byte[] bytes)

public final String

Returns:

String representation.
toString
()

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

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

Field Detail

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

Constructor Detail

Unknownback to summary
public Unknown(Unknown c)

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

Unknownback to summary
public Unknown(int name_index, int length, byte[] bytes, ConstantPool constant_pool)

Create a non-standard attribute.

Parameters
name_index:int

Index in constant pool

length:int

Content length in bytes

bytes:byte[]

Attribute contents

constant_pool:ConstantPool

Array of constants

Unknownback to summary
pack-priv Unknown(int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException

Construct object from file stream.

Parameters
name_index:int

Index in constant pool

length:int

Content length in bytes

file:DataInputStream

Input stream

constant_pool:ConstantPool

Array of constants

Method Detail

acceptback to summary
public void accept(ClassVisitor v)

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

Implements org.aspectj.apache.bcel.classfile.Node.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.

Parameters
v:ClassVisitor

Visitor object

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

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

Dump unknown bytes to file stream.

Parameters
file:DataOutputStream

Output file stream

Annotations
@Override
getBytesback to summary
public final byte[] getBytes()
Returns:byte[]

data bytes.

getNameback to summary
public String getName()

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

Returns:String

name of attribute.

Annotations
@Override
setBytesback to summary
public final void setBytes(byte[] bytes)
toStringback to summary
public final String toString()

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

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

String representation.

Annotations
@Override