Class ClassImpl

All Implemented Interfaces:
Iterable<ClassElement>, AttributedElement, ClassFileElement, ClassModel, CompoundElement<ClassElement>

public final class ClassImpl extends AbstractElement implements ClassModel
  • Constructor Details

    • ClassImpl

      public ClassImpl(byte[] cfbytes, ClassFileImpl context)
  • Method Details

    • classfileLength

      public int classfileLength()
    • flags

      public AccessFlags flags()
      Description copied from interface: ClassModel
      Returns the access flags.
      Specified by:
      flags in interface ClassModel
      Returns:
      the access flags
    • majorVersion

      public int majorVersion()
      Description copied from interface: ClassModel
      Returns the major classfile version.
      Specified by:
      majorVersion in interface ClassModel
      Returns:
      the major classfile version
    • minorVersion

      public int minorVersion()
      Description copied from interface: ClassModel
      Returns the minor classfile version.
      Specified by:
      minorVersion in interface ClassModel
      Returns:
      the minor classfile version
    • constantPool

      public ConstantPool constantPool()
      Description copied from interface: ClassModel
      Returns the constant pool for this class.
      Specified by:
      constantPool in interface ClassModel
      Returns:
      the constant pool for this class
    • thisClass

      public ClassEntry thisClass()
      Description copied from interface: ClassModel
      Returns the constant pool entry describing the name of this class.
      Specified by:
      thisClass in interface ClassModel
      Returns:
      the constant pool entry describing the name of this class
    • superclass

      public Optional<ClassEntry> superclass()
      Description copied from interface: ClassModel
      Returns the superclass of this class, if there is one.
      Specified by:
      superclass in interface ClassModel
      Returns:
      the superclass of this class, if there is one
    • interfaces

      public List<ClassEntry> interfaces()
      Description copied from interface: ClassModel
      Returns the interfaces implemented by this class.
      Specified by:
      interfaces in interface ClassModel
      Returns:
      the interfaces implemented by this class
    • attributes

      public List<Attribute<?>> attributes()
      Description copied from interface: AttributedElement
      Returns the attributes of this element.
      Specified by:
      attributes in interface AttributedElement
      Returns:
      the attributes of this element
    • forEachElement

      public void forEachElement(Consumer<ClassElement> consumer)
      Description copied from interface: CompoundElement
      Invoke the provided handler with each element contained in this compound element
      Specified by:
      forEachElement in interface CompoundElement<ClassElement>
      Parameters:
      consumer - the handler
    • fields

      public List<FieldModel> fields()
      Description copied from interface: ClassModel
      Returns the fields of this class.
      Specified by:
      fields in interface ClassModel
      Returns:
      the fields of this class
    • methods

      public List<MethodModel> methods()
      Description copied from interface: ClassModel
      Returns the methods of this class.
      Specified by:
      methods in interface ClassModel
      Returns:
      the methods of this class
    • isModuleInfo

      public boolean isModuleInfo()
      Description copied from interface: ClassModel
      Returns whether this class is a module descriptor.
      Specified by:
      isModuleInfo in interface ClassModel
      Returns:
      whether this class is a module descriptor
    • toString

      public String toString()
      Overrides:
      toString in class Object