Package com.tonic.parser.attribute
Class StackMapTableAttribute
- java.lang.Object
-
- com.tonic.parser.attribute.Attribute
-
- com.tonic.parser.attribute.StackMapTableAttribute
-
public class StackMapTableAttribute extends Attribute
The StackMapTable attribute: verification frames describing local and stack types at branch targets.
-
-
Constructor Summary
Constructors Constructor Description StackMapTableAttribute(String name, ClassFile parent, int nameIndex, int length)Creates the attribute shell for parsing, attached to a class.StackMapTableAttribute(String name, MemberEntry parent, int nameIndex, int length)Creates the attribute shell for parsing, attached to a member.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StackMapTableAttributecreate(String name, MemberEntry parent, int nameIndex, List<StackMapFrame> frames)Creates a new StackMapTableAttribute with the given frames.List<StackMapFrame>getFrames()intgetNumberOfEntries()voidread(ClassFile classFile, int length)Reads the attribute data from the class file.voidsetFrames(List<StackMapFrame> frames)Sets the frames for this StackMapTable.StringtoString()voidupdateLength()Recomputes the attribute length field from the current in-memory content.
-
-
-
Constructor Detail
-
StackMapTableAttribute
public StackMapTableAttribute(String name, MemberEntry parent, int nameIndex, int length)
Creates the attribute shell for parsing, attached to a member.- Parameters:
name- the attribute nameparent- the member the attribute belongs tonameIndex- constant-pool index of the name Utf8length- the attribute length in bytes
-
StackMapTableAttribute
public StackMapTableAttribute(String name, ClassFile parent, int nameIndex, int length)
Creates the attribute shell for parsing, attached to a class.- Parameters:
name- the attribute nameparent- the class the attribute belongs tonameIndex- constant-pool index of the name Utf8length- the attribute length in bytes
-
-
Method Detail
-
getNumberOfEntries
public int getNumberOfEntries()
- Returns:
- the number of entries
-
getFrames
public List<StackMapFrame> getFrames()
- Returns:
- the frames
-
setFrames
public void setFrames(List<StackMapFrame> frames)
Sets the frames for this StackMapTable.- Parameters:
frames- The list of StackMapFrame entries
-
create
public static StackMapTableAttribute create(String name, MemberEntry parent, int nameIndex, List<StackMapFrame> frames)
Creates a new StackMapTableAttribute with the given frames.- Parameters:
name- The attribute name ("StackMapTable")parent- The parent MemberEntry (method)nameIndex- The constant pool index for the attribute nameframes- The list of frames- Returns:
- A new StackMapTableAttribute
-
read
public void read(ClassFile classFile, int length)
Description copied from class:AttributeReads the attribute data from the class file.
-
updateLength
public void updateLength()
Description copied from class:AttributeRecomputes the attribute length field from the current in-memory content.- Specified by:
updateLengthin classAttribute
-
-