Uses of Class
java.lang.invoke.MethodHandles.Lookup
Packages that use MethodHandles.Lookup
Package
Description
Provides classes that are fundamental to the design of the Java
programming language.
Provides classfile parsing, generation, and transformation library.
Classes and interfaces to represent nominal descriptors for run-time
entities such as classes or method handles, and classfile entities such as
constant pool entries or
invokedynamic call sites.The
java.lang.invoke package provides low-level primitives for interacting
with the Java Virtual Machine.The
java.lang.runtime package provides low-level runtime support
for the Java language.-
Uses of MethodHandles.Lookup in java.lang
Methods in java.lang with parameters of type MethodHandles.LookupModifier and TypeMethodDescriptionDouble.resolveConstantDesc(MethodHandles.Lookup lookup) Resolves this instance as aConstantDesc, the result of which is the instance itself.Float.resolveConstantDesc(MethodHandles.Lookup lookup) Resolves this instance as aConstantDesc, the result of which is the instance itself.Integer.resolveConstantDesc(MethodHandles.Lookup lookup) Resolves this instance as aConstantDesc, the result of which is the instance itself.Long.resolveConstantDesc(MethodHandles.Lookup lookup) Resolves this instance as aConstantDesc, the result of which is the instance itself.String.resolveConstantDesc(MethodHandles.Lookup lookup) Resolves this instance as aConstantDesc, the result of which is the instance itself. -
Uses of MethodHandles.Lookup in java.lang.classfilePREVIEW
Methods in java.lang.classfilePREVIEW with parameters of type MethodHandles.LookupModifier and TypeMethodDescriptionClassHierarchyResolver.ofClassLoading(MethodHandles.Lookup lookup) Returns a ClassHierarchyResolver that extracts class hierarchy information via the Reflection API with a Lookup. -
Uses of MethodHandles.Lookup in java.lang.constant
Methods in java.lang.constant with parameters of type MethodHandles.LookupModifier and TypeMethodDescriptionDynamicCallSiteDesc.resolveCallSiteDesc(MethodHandles.Lookup lookup) Reflectively invokes the bootstrap method with the specified arguments, and return the resultingCallSiteClass<?> ClassDesc.resolveConstantDesc(MethodHandles.Lookup lookup) ConstantDesc.resolveConstantDesc(MethodHandles.Lookup lookup) DynamicConstantDesc.resolveConstantDesc(MethodHandles.Lookup lookup) MethodHandleDesc.resolveConstantDesc(MethodHandles.Lookup lookup) MethodTypeDesc.resolveConstantDesc(MethodHandles.Lookup lookup) -
Uses of MethodHandles.Lookup in java.lang.invoke
Methods in java.lang.invoke that return MethodHandles.LookupModifier and TypeMethodDescriptionMethodHandles.Lookup.defineHiddenClass(byte[] bytes, boolean initialize, MethodHandles.Lookup.ClassOption... options) Creates a hidden class or interface frombytes, returning aLookupon the newly created class or interface.MethodHandles.Lookup.defineHiddenClassWithClassData(byte[] bytes, Object classData, boolean initialize, MethodHandles.Lookup.ClassOption... options) Creates a hidden class or interface frombyteswith associated class data, returning aLookupon the newly created class or interface.MethodHandles.Lookup.dropLookupMode(int modeToDrop) Creates a lookup on the same lookup class which this lookup object finds members, but with a lookup mode that has lost the given lookup mode.Creates a lookup on the specified new lookup class.static MethodHandles.LookupMethodHandles.lookup()Returns alookup objectwith full capabilities to emulate all supported bytecode behaviors of the caller.static MethodHandles.LookupMethodHandles.privateLookupIn(Class<?> targetClass, MethodHandles.Lookup caller) Returns alookupobject on a target class to emulate all supported bytecode behaviors, including private access.static MethodHandles.LookupMethodHandles.publicLookup()Returns alookup objectwhich is trusted minimally.Methods in java.lang.invoke with parameters of type MethodHandles.LookupModifier and TypeMethodDescriptionstatic CallSiteLambdaMetafactory.altMetafactory(MethodHandles.Lookup caller, String interfaceMethodName, MethodType factoryType, Object... args) Facilitates the creation of simple "function objects" that implement one or more interfaces by delegation to a providedMethodHandle, after appropriate type adaptation and partial evaluation of arguments.static VarHandleConstantBootstraps.arrayVarHandle(MethodHandles.Lookup lookup, String name, Class<VarHandle> type, Class<?> arrayClass) Finds aVarHandlefor an array type.static <T> TMethodHandles.classData(MethodHandles.Lookup caller, String name, Class<T> type) Returns the class data associated with the lookup class of the givencallerlookup object, ornull.static <T> TMethodHandles.classDataAt(MethodHandles.Lookup caller, String name, Class<T> type, int index) Returns the element at the specified index in the class data, if the class data associated with the lookup class of the givencallerlookup object is aList.static <E extends Enum<E>>
EConstantBootstraps.enumConstant(MethodHandles.Lookup lookup, String name, Class<E> type) Returns anenumconstant of the type specified bytypewith the name specified byname.static ObjectConstantBootstraps.explicitCast(MethodHandles.Lookup lookup, String name, Class<?> dstType, Object value) Applies a conversion from a source type to a destination type.static VarHandleConstantBootstraps.fieldVarHandle(MethodHandles.Lookup lookup, String name, Class<VarHandle> type, Class<?> declaringClass, Class<?> fieldType) Finds aVarHandlefor an instance field.static ObjectConstantBootstraps.getStaticFinal(MethodHandles.Lookup lookup, String name, Class<?> type) Returns the value of a static final field declared in the class which is the same as the field's type (or, for primitive-valued fields, declared in the wrapper class.)static ObjectConstantBootstraps.getStaticFinal(MethodHandles.Lookup lookup, String name, Class<?> type, Class<?> declaringClass) Returns the value of a static final field.static ObjectConstantBootstraps.invoke(MethodHandles.Lookup lookup, String name, Class<?> type, MethodHandle handle, Object... args) Returns the result of invoking a method handle with the provided arguments.static CallSiteStringConcatFactory.makeConcat(MethodHandles.Lookup lookup, String name, MethodType concatType) Facilitates the creation of optimized String concatenation methods, that can be used to efficiently concatenate a known number of arguments of known types, possibly after type adaptation and partial evaluation of arguments.static CallSiteStringConcatFactory.makeConcatWithConstants(MethodHandles.Lookup lookup, String name, MethodType concatType, String recipe, Object... constants) Facilitates the creation of optimized String concatenation methods, that can be used to efficiently concatenate a known number of arguments of known types, possibly after type adaptation and partial evaluation of arguments.static CallSiteLambdaMetafactory.metafactory(MethodHandles.Lookup caller, String interfaceMethodName, MethodType factoryType, MethodType interfaceMethodType, MethodHandle implementation, MethodType dynamicMethodType) Facilitates the creation of simple "function objects" that implement one or more interfaces by delegation to a providedMethodHandle, after appropriate type adaptation and partial evaluation of arguments.static ObjectConstantBootstraps.nullConstant(MethodHandles.Lookup lookup, String name, Class<?> type) Returns anullobject reference for the reference type specified bytype.static Class<?> ConstantBootstraps.primitiveClass(MethodHandles.Lookup lookup, String name, Class<?> type) Returns aClassmirror for the primitive type whose type descriptor is specified byname.static MethodHandles.LookupMethodHandles.privateLookupIn(Class<?> targetClass, MethodHandles.Lookup caller) Returns alookupobject on a target class to emulate all supported bytecode behaviors, including private access.<T extends Member>
TMethodHandleInfo.reflectAs(Class<T> expected, MethodHandles.Lookup lookup) Reflects the underlying member as a method, constructor, or field object.static VarHandleConstantBootstraps.staticFieldVarHandle(MethodHandles.Lookup lookup, String name, Class<VarHandle> type, Class<?> declaringClass, Class<?> fieldType) Finds aVarHandlefor a static field. -
Uses of MethodHandles.Lookup in java.lang.runtime
Methods in java.lang.runtime with parameters of type MethodHandles.LookupModifier and TypeMethodDescriptionstatic ObjectObjectMethods.bootstrap(MethodHandles.Lookup lookup, String methodName, TypeDescriptor type, Class<?> recordClass, String names, MethodHandle... getters) Bootstrap method to generate theObject.equals(Object),Object.hashCode(), andObject.toString()methods, based on a description of the component names and accessor methods, for eitherinvokedynamiccall sites or dynamic constant pool entries.static CallSiteSwitchBootstraps.enumSwitch(MethodHandles.Lookup lookup, String invocationName, MethodType invocationType, Object... labels) Bootstrap method for linking aninvokedynamiccall site that implements aswitchon a target of an enum type.static CallSiteTemplateRuntime.newLargeStringTemplate(MethodHandles.Lookup lookup, String name, MethodType type) String template bootstrap method for creating large string templates, i.e., when the number of value slots exceedsStringConcatFactory.MAX_INDY_CONCAT_ARG_SLOTSPREVIEW.static CallSiteTemplateRuntime.newStringTemplate(MethodHandles.Lookup lookup, String name, MethodType type, String... fragments) String template bootstrap method for creating string templates.static CallSiteTemplateRuntime.processStringTemplate(MethodHandles.Lookup lookup, String name, MethodType type, MethodHandle processorGetter, String... fragments) String template bootstrap method for static final processors.static CallSiteSwitchBootstraps.typeSwitch(MethodHandles.Lookup lookup, String invocationName, MethodType invocationType, Object... labels) Bootstrap method for linking aninvokedynamiccall site that implements aswitchon a target of a reference type.