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

public Class Util

extends Object
Class Inheritance
Imports
java.lang.constant.ClassDesc, .MethodTypeDesc, .ModuleDesc, java.util.AbstractList, .Collection, .List, java.util.function.Function, java.lang.classfile.Attribute, .AttributeMapper, .ClassFile, .Opcode, java.lang.classfile.constantpool.ClassEntry, .ModuleEntry, .NameAndTypeEntry, java.lang.reflect.AccessFlag, jdk.internal.access.SharedSecrets

Helper to create and manipulate type descriptors, where type descriptors are represented as JVM type descriptor strings and symbols are represented as name strings

Field Summary

Modifier and TypeField and Description
private static final int

Constructor Summary

AccessConstructor and Description
private
Util()

Method Summary

Modifier and TypeMethod and Description
public static void
public static List<ClassEntry>
entryList(List<? extends ClassDesc> list)

public static ClassDesc
public static int
public static int
public static boolean
has(AccessFlag.Location location, int flagsMask, AccessFlag flag)

public static boolean
isAttributeAllowed(final Attribute<?> attr, final ClassFile.AttributesProcessingOption processingOption)

public static boolean
public static <T, U> List<U>
mappedList(List<? extends T> list, Function<T, U> mapper)

public static int
maxLocals(int flags, MethodTypeDesc mDesc)

public static MethodTypeDesc
public static List<ModuleEntry>
moduleEntryList(List<? extends ModuleDesc> list)

public static int
public static int[]
public static int
public static String
toBinaryName(ClassDesc cd)

Converts a descriptor of classes or interfaces into a binary name.

public static ClassDesc
toClassDesc(String classInternalNameOrArrayDesc)

public static String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ATTRIBUTE_STABILITY_COUNTback to summary
private static final int ATTRIBUTE_STABILITY_COUNT

Constructor Detail

Utilback to summary
private Util()

Method Detail

checkKindback to summary
public static void checkKind(Opcode op, Opcode.Kind k)
entryListback to summary
public static List<ClassEntry> entryList(List<? extends ClassDesc> list)
fieldTypeSymbolback to summary
public static ClassDesc fieldTypeSymbol(NameAndTypeEntry nat)
flagsToBitsback to summary
public static int flagsToBits(AccessFlag.Location location, Collection<AccessFlag> flags)
flagsToBitsback to summary
public static int flagsToBits(AccessFlag.Location location, AccessFlag... flags)
hasback to summary
public static boolean has(AccessFlag.Location location, int flagsMask, AccessFlag flag)
isAttributeAllowedback to summary
public static boolean isAttributeAllowed(final Attribute<?> attr, final ClassFile.AttributesProcessingOption processingOption)
isDoubleSlotback to summary
public static boolean isDoubleSlot(ClassDesc desc)
mappedListback to summary
public static <T, U> List<U> mappedList(List<? extends T> list, Function<T, U> mapper)
maxLocalsback to summary
public static int maxLocals(int flags, MethodTypeDesc mDesc)
methodTypeSymbolback to summary
public static MethodTypeDesc methodTypeSymbol(NameAndTypeEntry nat)
moduleEntryListback to summary
public static List<ModuleEntry> moduleEntryList(List<? extends ModuleDesc> list)
parameterSlotsback to summary
public static int parameterSlots(MethodTypeDesc mDesc)
parseParameterSlotsback to summary
public static int[] parseParameterSlots(int flags, MethodTypeDesc mDesc)
slotSizeback to summary
public static int slotSize(ClassDesc desc)
toBinaryNameback to summary
public static String toBinaryName(ClassDesc cd)

Converts a descriptor of classes or interfaces into a binary name. Rejects primitive types or arrays. This is an inverse of ClassDesc#of(String).

toClassDescback to summary
public static ClassDesc toClassDesc(String classInternalNameOrArrayDesc)
toInternalNameback to summary
public static String toInternalName(ClassDesc cd)