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

public final Class StackMap

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

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

public int
public StackMapEntry[]
getStackMap()

Returns: Array of stack map entries

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

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

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 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.

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