Class PermittedSubclassesAttribute


  • public class PermittedSubclassesAttribute
    extends Attribute
    The PermittedSubclasses attribute.
    • Constructor Detail

      • PermittedSubclassesAttribute

        public PermittedSubclassesAttribute​(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
      • PermittedSubclassesAttribute

        public PermittedSubclassesAttribute​(String name,
                                            ClassFile hostClass,
                                            int nameIndex,
                                            int length)
        Creates the attribute shell for parsing, attached to a class.
        Parameters:
        name - the attribute name
        hostClass - the class the attribute belongs to
        nameIndex - constant-pool index of the name Utf8
        length - the attribute length in bytes
    • Method Detail

      • getClasses

        public List<Integer> getClasses()
        Returns:
        the classes
      • 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
      • getPermittedClassNames

        public List<String> getPermittedClassNames()
        Resolves each stored class index against the constant pool.
        Returns:
        internal names of the permitted subclasses, in declaration order