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

public final Record ParserVerifier

extends Record
Class Inheritance
Record Components
classModel:ClassModel 
Imports
java.lang.classfile.*, java.lang.classfile.attribute.*, java.lang.classfile.constantpool.*, java.lang.constant.ClassDesc, .ConstantDescs, java.lang.reflect.AccessFlag, java.util.ArrayList, .Collection, .HashSet, .List, java.util.stream.Collectors, java.util.function.Function, .ToIntFunction, jdk.internal.classfile.impl.BoundAttribute, .Util

ParserVerifier performs selected checks of the class file format according to 4.8 Format Checking.

From classFileParser.cpp.

Field Summary

Modifier and TypeField and Description
private final ClassModel
classModel

Record Component accessed by classModel().

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static int
private static int
private static int
public ClassModel
classModel()

Record Component getter of classModel.

private String
private static int
private VerifyError
cpeVerifyError(final PoolEntry cpe, final Throwable e)

public final boolean
equals(Object 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.

private static int
private static int
private int
private static <T, S extends Collection<?>> int
subSize(Collection<T> entries, Function<T, S> subMH, int entrySize, int subSize)

private static <T> int
subSize(Collection<T> entries, ToIntFunction<T> subMH)

private String
public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

private static int
private static int
private static int
pack-priv List<VerifyError>
private void
private void
private void
private void
private void
private void
private void
private void

Field Detail

classModelback to summary
private final ClassModel classModel

Record Component accessed by classModel().

Constructor Detail

ParserVerifierback to summary
public ParserVerifier(ClassModel classModel)

Method Detail

annotationSizeback to summary
private static int annotationSize(Annotation an)
annotationsSizeback to summary
private static int annotationsSize(List<Annotation> ans)
attributesSizeback to summary
private static int attributesSize(List<Attribute<?>> attrs)
classModelback to summary
public ClassModel classModel()

Record Component getter of classModel.

classNameback to summary
private String className()
componentsSizeback to summary
private static int componentsSize(List<RecordComponentInfo> comps)
cpeVerifyErrorback to summary
private VerifyError cpeVerifyError(final PoolEntry cpe, final Throwable e)
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).
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.

moduleHashesSizeback to summary
private static int moduleHashesSize(List<ModuleHashInfo> hashes)
parameterAnnotationsSizeback to summary
private static int parameterAnnotationsSize(List<List<Annotation>> pans)
stackMapFrameSizeback to summary
private int stackMapFrameSize(StackMapFrameInfo frame)
subSizeback to summary
private static <T, S extends Collection<?>> int subSize(Collection<T> entries, Function<T, S> subMH, int entrySize, int subSize)
subSizeback to summary
private static <T> int subSize(Collection<T> entries, ToIntFunction<T> subMH)
toStringback to summary
private String toString(AttributedElement ae)
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.

typeAnnotationsSizeback to summary
private static int typeAnnotationsSize(List<TypeAnnotation> ans)
valueSizeback to summary
private static int valueSize(AnnotationValue val)
verificationTypeSizeback to summary
private static int verificationTypeSize(StackMapFrameInfo.VerificationTypeInfo vti)
verifyback to summary
pack-priv List<VerifyError> verify()
verifyAttributeback to summary
private void verifyAttribute(AttributedElement ae, Attribute<?> a, List<VerifyError> errors)
verifyAttributesback to summary
private void verifyAttributes(ClassFileElement cfe, List<VerifyError> errors)
verifyConstantPoolback to summary
private void verifyConstantPool(List<VerifyError> errors)
verifyFieldNameback to summary
private void verifyFieldName(String name)
verifyFieldsback to summary
private void verifyFields(List<VerifyError> errors)
verifyInterfacesback to summary
private void verifyInterfaces(List<VerifyError> errors)
verifyMethodNameback to summary
private void verifyMethodName(String name)
verifyMethodsback to summary
private void verifyMethods(List<VerifyError> errors)