org.logicalcobwebs.asm
Class Attribute

java.lang.Object
  extended by org.logicalcobwebs.asm.Attribute

public class Attribute
extends java.lang.Object

A non standard class, field, method or code attribute.


Field Summary
 byte[] b
          The byte array that contains the value of this attribute.
 int len
          Length of this attributes, in bytes.
 Attribute next
          The next attribute in this attribute list.
 int off
          Index of the first byte of this attribute in b.
 java.lang.String type
          The type of this attribute.
 
Constructor Summary
Attribute(java.lang.String type)
          Constructs a new empty attribute.
Attribute(java.lang.String type, byte[] b, int off, int len)
          Constructs a new Attribute.
 
Method Summary
(package private)  int getCount()
          Returns the length of the attribute list that begins with this attribute.
(package private)  int getSize(ClassWriter cw)
          Returns the size of all the attributes in this attribute list.
(package private)  void put(ClassWriter cw, ByteVector out)
          Writes all the attributes of this attribute list in the given byte vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

public java.lang.String type
The type of this attribute.


b

public byte[] b
The byte array that contains the value of this attribute. The content of this array must not be modified, although the array itself can be changed (i.e. attr.b[...] = ...; is forbidden, but attr.b = ...; is allowed).


off

public int off
Index of the first byte of this attribute in b.


len

public int len
Length of this attributes, in bytes.


next

public Attribute next
The next attribute in this attribute list. May be null.

Constructor Detail

Attribute

public Attribute(java.lang.String type,
                 byte[] b,
                 int off,
                 int len)
Constructs a new Attribute.

Parameters:
type - the type of the attribute.
b - byte array that contains the value of the attribute.
off - index of the first byte of the attribute in b.
len - length of the attributes, in bytes.

Attribute

public Attribute(java.lang.String type)
Constructs a new empty attribute.

Parameters:
type - the type of the attribute.
Method Detail

getCount

final int getCount()
Returns the length of the attribute list that begins with this attribute.

Returns:
the length of the attribute list that begins with this attribute.

getSize

final int getSize(ClassWriter cw)
Returns the size of all the attributes in this attribute list.

Parameters:
cw - the class writer to be used to convert the attributes into byte arrays, with the writeAttribute method.
Returns:
the size of all the attributes in this attribute list. This size includes the size of the attribute headers.

put

final void put(ClassWriter cw,
               ByteVector out)
Writes all the attributes of this attribute list in the given byte vector.

Parameters:
cw - the class writer to be used to convert the attributes into byte arrays, with the writeAttribute method.
out - where the attributes must be written.