jellyj.classfile.javaclass
Class Unknown

jellyj.classfile.javaclass.Attribute
  |
  +--jellyj.classfile.javaclass.Unknown

public final class Unknown
extends Attribute

This class is derived from Attribute and represents a reference to an unknown (i.e. unimplemented) attribute of this class. It is instantiated from the Attribute.readAttribute() method.

Author:
JellyJ Design Group
See Also: Attribute

Constructor Summary
 Unknown()
          Empty constructor, all attributes have to be defined via `setXXX' methods.
 Unknown(Unknown c)
          Initialize from another object.
 Unknown(int name_index, int length, byte[] bytes, ConstantPool constant_pool)
          Create a non-standard attribute.
 (package private) Unknown(int name_index, int length, DataInputStream file, ConstantPool constant_pool)
          Construct object from file stream.

Method Summary
 voidaccept(Visitor v)
          Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
 final voiddump(DataOutputStream file)
          Dump unknown bytes to file stream.
 final byte[]getBytes()
           
 final ConstantPoolgetConstantPool()
           
 final StringgetName()
           
 (package private) static Unknown[]getUnknownAttributes()
           
 final voidsetBytes(byte[] bytes)
           
 final voidsetConstantPool(ConstantPool constant_pool)
           
 final StringtoString()
           

Methods inherited from class jellyj.classfile.javaclass.Attribute
getLength, getNameIndex, getTag, readAttribute, setLength, setNameIndex

Constructor Detail

Unknown

public Unknown()
Empty constructor, all attributes have to be defined via `setXXX' methods. Use at your own risk.

Unknown

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

Unknown

public Unknown(int name_index, int length, byte[] bytes, ConstantPool constant_pool)
Create a non-standard attribute.
Parameters:
name_index - Index in constant pool
length - Content length in bytes
bytes - Attribute contents
constant_pool - Array of constants

Unknown

Unknown(int name_index, int length, DataInputStream file, ConstantPool constant_pool)
throws java.io.IOException
Construct object from file stream.
Parameters:
name_index - Index in constant pool
length - Content length in bytes
file - Input stream
constant_pool - Array of constants
throw IOException
Method Detail

accept

public void accept(Visitor v)
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 - Visitor object

dump

public final void dump(DataOutputStream file)
throws java.io.IOException
Dump unknown bytes to file stream.
Parameters:
file - Output file stream
throw IOException

getBytes

public final byte[] getBytes()
Returns: data bytes.

getConstantPool

public final ConstantPool getConstantPool()
Returns: Constant pool used by this object.
See Also:
ConstantPool

getName

public final String getName()
Returns: name of attribute.

getUnknownAttributes

static Unknown[] getUnknownAttributes()
Returns: array of unknown attributes, but just one for each kind.

setBytes

public final void setBytes(byte[] bytes)
Parameters:
bytes.

setConstantPool

public final void setConstantPool(ConstantPool constant_pool)
Parameters:
constant_pool - Constant pool to be used for this object.
See Also:
ConstantPool

toString

public final String toString()
Returns: String representation.

Association Links

to Class jellyj.classfile.javaclass.ConstantPool

to Class java.lang.String

to Class java.util.Hashtable