Package com.tonic.parser.attribute
Class ModuleAttribute
- java.lang.Object
-
- com.tonic.parser.attribute.Attribute
-
- com.tonic.parser.attribute.ModuleAttribute
-
public class ModuleAttribute extends Attribute
The Module attribute: a module declaration's requires/exports/opens/uses/provides tables.
-
-
Constructor Summary
Constructors Constructor Description ModuleAttribute(String name, ClassFile parent, int nameIndex, int length)Creates the attribute shell for parsing, attached to a class.ModuleAttribute(String name, MemberEntry parent, int nameIndex, int length)Creates the attribute shell for parsing, attached to a member.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Exports>getExports()intgetModuleFlags()intgetModuleNameIndex()intgetModuleVersionIndex()List<Opens>getOpens()List<Provides>getProvides()List<Requires>getRequires()List<Uses>getUses()voidread(ClassFile classFile, int length)Reads the attribute data from the class file.StringtoString()voidupdateLength()Recomputes the attribute length field from the current in-memory content.
-
-
-
Constructor Detail
-
ModuleAttribute
public ModuleAttribute(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
-
ModuleAttribute
public ModuleAttribute(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
-
getModuleNameIndex
public int getModuleNameIndex()
- Returns:
- the module name index
-
getModuleFlags
public int getModuleFlags()
- Returns:
- the module flags
-
getModuleVersionIndex
public int getModuleVersionIndex()
- Returns:
- the module version index
-
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
-
-