APIdia Launch Partner
Top Fields Constructors Methods
jdk.internal.classfile.impl

public final Class ClassImpl

extends AbstractElement
implements ClassModel
Class Inheritance
All Implemented Interfaces
java.lang.classfile.ClassModel, java.lang.classfile.AttributedElement, java.lang.classfile.ClassFileElement, java.lang.classfile.CompoundElement, java.lang.Iterable
Imports
java.lang.classfile.*, java.lang.classfile.attribute.*, java.lang.classfile.constantpool.ClassEntry, .ConstantPool, java.lang.reflect.AccessFlag, java.util.List, .Optional, java.util.function.Consumer, jdk.internal.access.SharedSecrets

Field Summary

Modifier and TypeField and Description
private List<Attribute<?>>
private final int
private final List<FieldModel>
private List<ClassEntry>
private final List<MethodModel>
pack-priv final ClassReaderImpl

Constructor Summary

AccessConstructor and Description
public
ClassImpl(byte[] cfbytes, ClassFileImpl context)

Method Summary

Modifier and TypeMethod and Description
public List<Attribute<?>>
attributes()

Implements java.lang.classfile.AttributedElement.attributes.

Returns the attributes of this structure.

public int
public ConstantPool
constantPool()

Implements java.lang.classfile.ClassModel.constantPool.

Returns the constant pool for this class.

public List<FieldModel>
fields()

Implements java.lang.classfile.ClassModel.fields.

Returns the fields of this class.

public AccessFlags
flags()

Implements java.lang.classfile.ClassModel.flags.

Returns the access flags.

public void
forEach(Consumer<? super ClassElement> consumer)

Implements java.lang.classfile.CompoundElement.forEach.

Invokes the provided handler with each member element in this compound element.

public List<ClassEntry>
interfaces()

Implements java.lang.classfile.ClassModel.interfaces.

Returns the interfaces implemented by this class.

public boolean
isModuleInfo()

Implements java.lang.classfile.ClassModel.isModuleInfo.

Returns whether this class file is a module descriptor.

public int
majorVersion()

Implements java.lang.classfile.ClassModel.majorVersion.

Returns the major version of this class.

public List<MethodModel>
methods()

Implements java.lang.classfile.ClassModel.methods.

Returns the methods of this class.

public int
minorVersion()

Implements java.lang.classfile.ClassModel.minorVersion.

Returns the minor version of this class.

public Optional<ClassEntry>
superclass()

Implements java.lang.classfile.ClassModel.superclass.

Returns the superclass of this class, if there is one.

public ClassEntry
thisClass()

Implements java.lang.classfile.ClassModel.thisClass.

Returns the constant pool entry describing the name of this class.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

private boolean
Inherited from jdk.internal.classfile.impl.AbstractElement:
writeTowriteTowriteTowriteTo

Field Detail

attributesback to summary
private List<Attribute<?>> attributes
attributesPosback to summary
private final int attributesPos
fieldsback to summary
private final List<FieldModel> fields
interfacesback to summary
private List<ClassEntry> interfaces
methodsback to summary
private final List<MethodModel> methods
readerback to summary
pack-priv final ClassReaderImpl reader

Constructor Detail

ClassImplback to summary
public ClassImpl(byte[] cfbytes, ClassFileImpl context)

Method Detail

attributesback to summary
public List<Attribute<?>> attributes()

Implements java.lang.classfile.AttributedElement.attributes.

Doc from java.lang.classfile.AttributedElement.attributes.

Returns the attributes of this structure.

Annotations
@Override
classfileLengthback to summary
public int classfileLength()
constantPoolback to summary
public ConstantPool constantPool()

Implements java.lang.classfile.ClassModel.constantPool.

Doc from java.lang.classfile.ClassModel.constantPool.

Returns the constant pool for this class.

Annotations
@Override
fieldsback to summary
public List<FieldModel> fields()

Implements java.lang.classfile.ClassModel.fields.

Doc from java.lang.classfile.ClassModel.fields.

Returns the fields of this class.

Annotations
@Override
flagsback to summary
public AccessFlags flags()

Implements java.lang.classfile.ClassModel.flags.

Doc from java.lang.classfile.ClassModel.flags.

Returns the access flags.

Annotations
@Override
forEachback to summary
public void forEach(Consumer<? super ClassElement> consumer)

Implements java.lang.classfile.CompoundElement.forEach.

Doc from java.lang.classfile.CompoundElement.forEach.

Invokes the provided handler with each member element in this compound element.

Annotations
@Override
interfacesback to summary
public List<ClassEntry> interfaces()

Implements java.lang.classfile.ClassModel.interfaces.

Doc from java.lang.classfile.ClassModel.interfaces.

Returns the interfaces implemented by this class.

Annotations
@Override
isModuleInfoback to summary
public boolean isModuleInfo()

Implements java.lang.classfile.ClassModel.isModuleInfo.

Doc from java.lang.classfile.ClassModel.isModuleInfo.

Returns whether this class file is a module descriptor.

Annotations
@Override
majorVersionback to summary
public int majorVersion()

Implements java.lang.classfile.ClassModel.majorVersion.

Doc from java.lang.classfile.ClassModel.majorVersion.

Returns the major version of this class. It is a u2 value.

Annotations
@Override
methodsback to summary
public List<MethodModel> methods()

Implements java.lang.classfile.ClassModel.methods.

Doc from java.lang.classfile.ClassModel.methods.

Returns the methods of this class.

Annotations
@Override
minorVersionback to summary
public int minorVersion()

Implements java.lang.classfile.ClassModel.minorVersion.

Doc from java.lang.classfile.ClassModel.minorVersion.

Returns the minor version of this class. It is a u2 value.

Annotations
@Override
superclassback to summary
public Optional<ClassEntry> superclass()

Implements java.lang.classfile.ClassModel.superclass.

Doc from java.lang.classfile.ClassModel.superclass.

Returns the superclass of this class, if there is one. This class file may have no superclass if this represents a module descriptor or the Object class; otherwise, it must have a superclass. If this is an interface, the superclass must be Object.

Annotations
@Override
thisClassback to summary
public ClassEntry thisClass()

Implements java.lang.classfile.ClassModel.thisClass.

Doc from java.lang.classfile.ClassModel.thisClass.

Returns the constant pool entry describing the name of this class.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
verifyModuleAttributesback to summary
private boolean verifyModuleAttributes()