Class ModuleAttribute


  • public class ModuleAttribute
    extends Attribute
    The Module attribute: a module declaration's requires/exports/opens/uses/provides tables.
    • 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 name
        parent - the member the attribute belongs to
        nameIndex - constant-pool index of the name Utf8
        length - 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 name
        parent - the class the attribute belongs to
        nameIndex - constant-pool index of the name Utf8
        length - 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
      • getRequires

        public List<Requires> getRequires()
        Returns:
        the requires
      • getExports

        public List<Exports> getExports()
        Returns:
        the exports
      • getOpens

        public List<Opens> getOpens()
        Returns:
        the opens
      • getUses

        public List<Uses> getUses()
        Returns:
        the uses
      • getProvides

        public List<Provides> getProvides()
        Returns:
        the provides
      • read

        public void read​(ClassFile classFile,
                         int length)
        Description copied from class: Attribute
        Reads the attribute data from the class file.
        Specified by:
        read in class Attribute
        Parameters:
        classFile - The ClassFile utility to read data.
        length - The length of the attribute.
      • updateLength

        public void updateLength()
        Description copied from class: Attribute
        Recomputes the attribute length field from the current in-memory content.
        Specified by:
        updateLength in class Attribute