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

public final Class StackMap

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

This class represents a stack map attribute used for preverification of Java classes for the Java 2 Micro Edition (J2ME). This attribute is used by the KVM and contained within the Code attribute of a method. See CLDC specification �5.3.1.2
StackMapTable_attribute {
  u2              attribute_name_index;
  u4              attribute_length;
  u2              number_of_entries;
  stack_map_frame entries[number_of_entries];
}
See Also
Code, StackMapEntry, StackMapType

Field Summary

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

Constructor Summary

AccessConstructor and Description
pack-priv
StackMap(final int
Index of name
nameIndex
,
final int
Content length in bytes
length
,
final DataInput
Input stream
dataInput
,
final ConstantPool
Array of constants
constantPool
)

Constructs object from input stream.

public
StackMap(final int nameIndex, final int length, final StackMapEntry[] table, final ConstantPool constantPool)

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.

Dump stack map table attribute to file stream in binary format.
public int
public StackMapEntry[]

Returns:

Array of stack map entries
getStackMap
()

public void
setStackMap(final StackMapEntry[]
Array of stack map entries
table
)

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:
addAttributeReaderaddAttributeReaderclonegetConstantPoolgetLengthgetNamegetNameIndexgetTagprintlnreadAttributereadAttributeremoveAttributeReadersetConstantPoolsetLengthsetNameIndex

Field Detail

tableback to summary
private StackMapEntry[] table

Constructor Detail

StackMapback to summary
pack-priv StackMap(final int nameIndex, final int length, final DataInput dataInput, final ConstantPool constantPool) throws IOException

Constructs object from input stream.

Parameters
nameIndex:int

Index of name

length:int

Content length in bytes

dataInput:DataInput

Input stream

constantPool:ConstantPool

Array of constants

Exceptions
IOException:
if an I/O error occurs.
StackMapback to summary
public StackMap(final int nameIndex, final int length, final StackMapEntry[] table, final ConstantPool constantPool)

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.

Dump stack map table attribute to file stream in binary format.

Parameters
file:DataOutputStream

Output file stream

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
getMapLengthback to summary
public int getMapLength()
getStackMapback to summary
public StackMapEntry[] getStackMap()
Returns:StackMapEntry[]

Array of stack map entries

setStackMapback to summary
public void setStackMap(final StackMapEntry[] table)
Parameters
table:StackMapEntry[]

Array of stack map entries

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