Top Inners Fields Constructors Methods
jdk.internal.classfile.impl

public final Record ClassFileImpl

extends Record
implements ClassFile
Class Inheritance
All Implemented Interfaces
java.lang.classfile.ClassFile
Record Components
stackMapsOption:ClassFile.StackMapsOption
debugElementsOption:ClassFile.DebugElementsOption
lineNumbersOption:ClassFile.LineNumbersOption
attributesProcessingOption:ClassFile.AttributesProcessingOption
constantPoolSharingOption:ClassFile.ConstantPoolSharingOption
shortJumpsOption:ClassFile.ShortJumpsOption
deadCodeOption:ClassFile.DeadCodeOption
deadLabelsOption:ClassFile.DeadLabelsOption
classHierarchyResolverOption:ClassFile.ClassHierarchyResolverOption
attributeMapperOption:ClassFile.AttributeMapperOption
Imports
java.util.List, java.util.function.Function, .Consumer, java.lang.classfile.AttributeMapper, .ClassFile, java.lang.classfile.ClassFile.*, .ClassBuilder, .ClassHierarchyResolver, .ClassModel, .ClassTransform, java.lang.classfile.constantpool.ClassEntry, .ConstantPoolBuilder, .Utf8Entry, jdk.internal.classfile.impl.verifier.VerifierImpl

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static record
public static record

Field Summary

Modifier and TypeField and Description
private final ClassFile.AttributeMapperOption
attributeMapperOption

Record Component accessed by attributeMapperOption().

private final ClassFile.AttributesProcessingOption
private final ClassFile.ClassHierarchyResolverOption
private final ClassFile.ConstantPoolSharingOption
private final ClassFile.DeadCodeOption
deadCodeOption

Record Component accessed by deadCodeOption().

private final ClassFile.DeadLabelsOption
deadLabelsOption

Record Component accessed by deadLabelsOption().

private final ClassFile.DebugElementsOption
debugElementsOption

Record Component accessed by debugElementsOption().

public static final ClassFileImpl
private final ClassFile.LineNumbersOption
lineNumbersOption

Record Component accessed by lineNumbersOption().

private final ClassFile.ShortJumpsOption
shortJumpsOption

Record Component accessed by shortJumpsOption().

private final ClassFile.StackMapsOption
stackMapsOption

Record Component accessed by stackMapsOption().

Constructor Summary

AccessConstructor and Description
public
ClassFileImpl(ClassFile.StackMapsOption stackMapsOption, ClassFile.DebugElementsOption debugElementsOption, ClassFile.LineNumbersOption lineNumbersOption, ClassFile.AttributesProcessingOption attributesProcessingOption, ClassFile.ConstantPoolSharingOption constantPoolSharingOption, ClassFile.ShortJumpsOption shortJumpsOption, ClassFile.DeadCodeOption deadCodeOption, ClassFile.DeadLabelsOption deadLabelsOption, ClassFile.ClassHierarchyResolverOption classHierarchyResolverOption, ClassFile.AttributeMapperOption attributeMapperOption)

Method Summary

Modifier and TypeMethod and Description
public ClassFile.AttributeMapperOption
attributeMapperOption()

Record Component getter of attributeMapperOption.

public ClassFile.AttributesProcessingOption
public byte[]
build(ClassEntry
the name of the class to build
thisClassEntry
,
ConstantPoolBuilder
the constant pool builder
constantPool
,
Consumer<? super ClassBuilder>
a handler that receives a ClassBuilder
handler
)

Implements java.lang.classfile.ClassFile.build.

Build a classfile into a byte array using the provided constant pool builder.

public ClassFile.ClassHierarchyResolverOption
public ClassFile.ConstantPoolSharingOption
public ClassFile.DeadCodeOption
deadCodeOption()

Record Component getter of deadCodeOption.

public ClassFile.DeadLabelsOption
deadLabelsOption()

Record Component getter of deadLabelsOption.

public ClassFile.DebugElementsOption
debugElementsOption()

Record Component getter of debugElementsOption.

public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public ClassFile.LineNumbersOption
lineNumbersOption()

Record Component getter of lineNumbersOption.

public ClassModel
parse(byte[]
the bytes of the classfile
bytes
)

Implements java.lang.classfile.ClassFile.parse.

Parse a classfile into a ClassModel.

public ClassFile.ShortJumpsOption
shortJumpsOption()

Record Component getter of shortJumpsOption.

public ClassFile.StackMapsOption
stackMapsOption()

Record Component getter of stackMapsOption.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

public byte[]
transform(ClassModel
the class model to transform
model
,
ClassEntry
new class name
newClassName
,
ClassTransform
the transform
transform
)

Implements java.lang.classfile.ClassFile.transform.

Transform one classfile into a new classfile with the aid of a ClassTransform.

public List<VerifyError>
verify(ClassModel
the class model to verify
model
)

Implements java.lang.classfile.ClassFile.verify.

Verify a classfile.

public List<VerifyError>
verify(byte[]
the classfile bytes to verify
bytes
)

Implements java.lang.classfile.ClassFile.verify.

Verify a classfile.

public ClassFileImpl
withOptions(ClassFile.Option...
the desired processing options
options
)

Implements java.lang.classfile.ClassFile.withOptions.

Returns a copy of the context with altered options.

Field Detail

attributeMapperOptionback to summary
private final ClassFile.AttributeMapperOption attributeMapperOption

Record Component accessed by attributeMapperOption().

attributesProcessingOptionback to summary
private final ClassFile.AttributesProcessingOption attributesProcessingOption

Record Component accessed by attributesProcessingOption().

classHierarchyResolverOptionback to summary
private final ClassFile.ClassHierarchyResolverOption classHierarchyResolverOption

Record Component accessed by classHierarchyResolverOption().

constantPoolSharingOptionback to summary
private final ClassFile.ConstantPoolSharingOption constantPoolSharingOption

Record Component accessed by constantPoolSharingOption().

deadCodeOptionback to summary
private final ClassFile.DeadCodeOption deadCodeOption

Record Component accessed by deadCodeOption().

deadLabelsOptionback to summary
private final ClassFile.DeadLabelsOption deadLabelsOption

Record Component accessed by deadLabelsOption().

debugElementsOptionback to summary
private final ClassFile.DebugElementsOption debugElementsOption

Record Component accessed by debugElementsOption().

DEFAULT_CONTEXTback to summary
public static final ClassFileImpl DEFAULT_CONTEXT
lineNumbersOptionback to summary
private final ClassFile.LineNumbersOption lineNumbersOption

Record Component accessed by lineNumbersOption().

shortJumpsOptionback to summary
private final ClassFile.ShortJumpsOption shortJumpsOption

Record Component accessed by shortJumpsOption().

stackMapsOptionback to summary
private final ClassFile.StackMapsOption stackMapsOption

Record Component accessed by stackMapsOption().

Constructor Detail

ClassFileImplback to summary
public ClassFileImpl(ClassFile.StackMapsOption stackMapsOption, ClassFile.DebugElementsOption debugElementsOption, ClassFile.LineNumbersOption lineNumbersOption, ClassFile.AttributesProcessingOption attributesProcessingOption, ClassFile.ConstantPoolSharingOption constantPoolSharingOption, ClassFile.ShortJumpsOption shortJumpsOption, ClassFile.DeadCodeOption deadCodeOption, ClassFile.DeadLabelsOption deadLabelsOption, ClassFile.ClassHierarchyResolverOption classHierarchyResolverOption, ClassFile.AttributeMapperOption attributeMapperOption)

Method Detail

attributeMapperOptionback to summary
public ClassFile.AttributeMapperOption attributeMapperOption()

Record Component getter of attributeMapperOption.

attributesProcessingOptionback to summary
public ClassFile.AttributesProcessingOption attributesProcessingOption()

Record Component getter of attributesProcessingOption.

buildback to summary
public byte[] build(ClassEntry thisClassEntry, ConstantPoolBuilder constantPool, Consumer<? super ClassBuilder> handler)

Implements java.lang.classfile.ClassFile.build.

Doc from java.lang.classfile.ClassFile.build.

Build a classfile into a byte array using the provided constant pool builder.

Parameters
thisClassEntry:ClassEntry

the name of the class to build

constantPool:ConstantPoolBuilder

the constant pool builder

handler:Consumer<? super ClassBuilder>

a handler that receives a ClassBuilder

Returns:byte[]

the classfile bytes

Annotations
@Override
classHierarchyResolverOptionback to summary
public ClassFile.ClassHierarchyResolverOption classHierarchyResolverOption()

Record Component getter of classHierarchyResolverOption.

constantPoolSharingOptionback to summary
public ClassFile.ConstantPoolSharingOption constantPoolSharingOption()

Record Component getter of constantPoolSharingOption.

deadCodeOptionback to summary
public ClassFile.DeadCodeOption deadCodeOption()

Record Component getter of deadCodeOption.

deadLabelsOptionback to summary
public ClassFile.DeadLabelsOption deadLabelsOption()

Record Component getter of deadLabelsOption.

debugElementsOptionback to summary
public ClassFile.DebugElementsOption debugElementsOption()

Record Component getter of debugElementsOption.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

lineNumbersOptionback to summary
public ClassFile.LineNumbersOption lineNumbersOption()

Record Component getter of lineNumbersOption.

parseback to summary
public ClassModel parse(byte[] bytes)

Implements java.lang.classfile.ClassFile.parse.

Doc from java.lang.classfile.ClassFile.parse.

Parse a classfile into a ClassModel.

Parameters
bytes:byte[]

the bytes of the classfile

Returns:ClassModel

the class model

Annotations
@Override
shortJumpsOptionback to summary
public ClassFile.ShortJumpsOption shortJumpsOption()

Record Component getter of shortJumpsOption.

stackMapsOptionback to summary
public ClassFile.StackMapsOption stackMapsOption()

Record Component getter of stackMapsOption.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.

transformback to summary
public byte[] transform(ClassModel model, ClassEntry newClassName, ClassTransform transform)

Implements java.lang.classfile.ClassFile.transform.

Doc from java.lang.classfile.ClassFile.transform.

Transform one classfile into a new classfile with the aid of a ClassTransform. The transform will receive each element of this class, as well as a ClassBuilder for building the new class. The transform is free to preserve, remove, or replace elements as it sees fit.

Parameters
model:ClassModel

the class model to transform

newClassName:ClassEntry

new class name

transform:ClassTransform

the transform

Returns:byte[]

the bytes of the new class

Annotations
@Override
verifyback to summary
public List<VerifyError> verify(ClassModel model)

Implements java.lang.classfile.ClassFile.verify.

Doc from java.lang.classfile.ClassFile.verify.

Verify a classfile. Any verification errors found will be returned.

Parameters
model:ClassModel

the class model to verify

Returns:List<VerifyError>

a list of verification errors, or an empty list if no errors are found

Annotations
@Override
verifyback to summary
public List<VerifyError> verify(byte[] bytes)

Implements java.lang.classfile.ClassFile.verify.

Doc from java.lang.classfile.ClassFile.verify.

Verify a classfile. Any verification errors found will be returned.

Parameters
bytes:byte[]

the classfile bytes to verify

Returns:List<VerifyError>

a list of verification errors, or an empty list if no errors are found

Annotations
@Override
withOptionsback to summary
public ClassFileImpl withOptions(ClassFile.Option... options)

Implements java.lang.classfile.ClassFile.withOptions.

Doc from java.lang.classfile.ClassFile.withOptions.

Returns a copy of the context with altered options.

Parameters
options:ClassFile.Option[]

the desired processing options

Returns:ClassFileImpl

a copy of the context with altered options

Annotations
@SuppressWarnings:unchecked
@Override
jdk.internal.classfile.impl back to summary

public final Record ClassFileImpl.AttributeMapperOptionImpl

extends Record
implements AttributeMapperOption
Class Inheritance
All Implemented Interfaces
java.lang.classfile.ClassFile.AttributeMapperOption, java.lang.classfile.ClassFile.Option
Record Components
attributeMapper:Function<Utf8Entry, AttributeMapper<?>> 

Field Summary

Modifier and TypeField and Description
private final Function<Utf8Entry, AttributeMapper<?>>
attributeMapper

Record Component accessed by attributeMapper().

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Function<Utf8Entry, AttributeMapper<?>>
attributeMapper()

Record Component getter of attributeMapper.

Implements java.lang.classfile.ClassFile.AttributeMapperOption.attributeMapper.

Returns the function mapping attribute names to attribute mappers.

public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

attributeMapperback to summary
private final Function<Utf8Entry, AttributeMapper<?>> attributeMapper

Record Component accessed by attributeMapper().

Constructor Detail

AttributeMapperOptionImplback to summary
public AttributeMapperOptionImpl(Function<Utf8Entry, AttributeMapper<?>> attributeMapper)

Method Detail

attributeMapperback to summary
public Function<Utf8Entry, AttributeMapper<?>> attributeMapper()

Record Component getter of attributeMapper.

Implements java.lang.classfile.ClassFile.AttributeMapperOption.attributeMapper.

Doc from java.lang.classfile.ClassFile.AttributeMapperOption.attributeMapper.

Returns the function mapping attribute names to attribute mappers.

Returns:Function<Utf8Entry, AttributeMapper<?>>

the function mapping attribute names to attribute mappers

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.

jdk.internal.classfile.impl back to summary

public final Record ClassFileImpl.ClassHierarchyResolverOptionImpl

extends Record
implements ClassHierarchyResolverOption
Class Inheritance
All Implemented Interfaces
java.lang.classfile.ClassFile.ClassHierarchyResolverOption, java.lang.classfile.ClassFile.Option
Record Components
classHierarchyResolver:ClassHierarchyResolver

Field Summary

Modifier and TypeField and Description
private final ClassHierarchyResolver
classHierarchyResolver

Record Component accessed by classHierarchyResolver().

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ClassHierarchyResolver
public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

classHierarchyResolverback to summary
private final ClassHierarchyResolver classHierarchyResolver

Record Component accessed by classHierarchyResolver().

Constructor Detail

ClassHierarchyResolverOptionImplback to summary
public ClassHierarchyResolverOptionImpl(ClassHierarchyResolver classHierarchyResolver)

Method Detail

classHierarchyResolverback to summary
public ClassHierarchyResolver classHierarchyResolver()

Record Component getter of classHierarchyResolver.

Implements java.lang.classfile.ClassFile.ClassHierarchyResolverOption.classHierarchyResolver.

Doc from java.lang.classfile.ClassFile.ClassHierarchyResolverOption.classHierarchyResolver.

Returns the class hierarchy resolver.

Returns:ClassHierarchyResolver

the class hierarchy resolver

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.