Uses of Class
java.lang.invoke.MethodType
-
Packages that use MethodType Package Description java.lang Provides classes that are fundamental to the design of the Java programming language.java.lang.invoke Thejava.lang.invokepackage provides low-level primitives for interacting with the Java Virtual Machine.jdk.dynalink Contains interfaces and classes that are used to link aninvokedynamiccall site.jdk.dynalink.linker Contains interfaces and classes needed by language runtimes to implement their own language-specific object models and type conversions.jdk.dynalink.linker.support Contains classes that make it more convenient for language runtimes to implement their own language-specific object models and type conversions by providing basic implementations of some classes as well as various utilities. -
-
Uses of MethodType in java.lang
Methods in java.lang that return MethodType Modifier and Type Method Description default MethodTypeStackWalker.StackFrame. getMethodType()Returns theMethodTyperepresenting the parameter types and the return type for the method represented by this stack frame. -
Uses of MethodType in java.lang.invoke
Methods in java.lang.invoke that return MethodType Modifier and Type Method Description MethodTypeVarHandle. accessModeType(VarHandle.AccessMode accessMode)Obtains the access mode type for this VarHandle and a given access mode.MethodTypeMethodType. appendParameterTypes(Class<?>... ptypesToInsert)Finds or creates a method type with additional parameter types.MethodTypeMethodType. appendParameterTypes(List<Class<?>> ptypesToInsert)Finds or creates a method type with additional parameter types.MethodTypeMethodType. changeParameterType(int num, Class<?> nptype)Finds or creates a method type with a single different parameter type.MethodTypeMethodType. changeReturnType(Class<?> nrtype)Finds or creates a method type with a different return type.MethodTypeMethodType. dropParameterTypes(int start, int end)Finds or creates a method type with some parameter types omitted.MethodTypeMethodType. erase()Erases all reference types toObject.static MethodTypeMethodType. fromMethodDescriptorString(String descriptor, ClassLoader loader)Finds or creates an instance of a method type, given the spelling of its bytecode descriptor.MethodTypeMethodType. generic()Converts all types, both reference and primitive, toObject.static MethodTypeMethodType. genericMethodType(int objectArgCount)Finds or creates a method type whose components are allObject.static MethodTypeMethodType. genericMethodType(int objectArgCount, boolean finalArray)Finds or creates a method type whose components areObjectwith an optional trailingObject[]array.MethodTypeMethodHandleInfo. getMethodType()Returns the nominal type of the cracked symbolic reference, expressed as a method type.MethodTypeMethodType. insertParameterTypes(int num, Class<?>... ptypesToInsert)Finds or creates a method type with additional parameter types.MethodTypeMethodType. insertParameterTypes(int num, List<Class<?>> ptypesToInsert)Finds or creates a method type with additional parameter types.static MethodTypeMethodType. methodType(Class<?> rtype)Finds or creates a method type with the given components.static MethodTypeMethodType. methodType(Class<?> rtype, Class<?> ptype0)Finds or creates a method type with the given components.static MethodTypeMethodType. methodType(Class<?> rtype, Class<?>[] ptypes)Finds or creates an instance of the given method type.static MethodTypeMethodType. methodType(Class<?> rtype, Class<?> ptype0, Class<?>... ptypes)Finds or creates a method type with the given components.static MethodTypeMethodType. methodType(Class<?> rtype, MethodType ptypes)Finds or creates a method type with the given components.static MethodTypeMethodType. methodType(Class<?> rtype, List<Class<?>> ptypes)Finds or creates a method type with the given components.MethodTypeCallSite. type()Returns the type of this call site's target.MethodTypeMethodHandle. type()Reports the type of this method handle.MethodTypeMethodType. unwrap()Converts all wrapper types to their corresponding primitive types.MethodTypeMethodType. wrap()Converts all primitive types to their corresponding wrapper types.Methods in java.lang.invoke with parameters of type MethodType Modifier and Type Method Description static CallSiteLambdaMetafactory. altMetafactory(MethodHandles.Lookup caller, String invokedName, MethodType invokedType, 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.MethodHandleMethodHandle. asType(MethodType newType)Produces an adapter method handle which adapts the type of the current method handle to a new type.MethodHandleMethodHandles.Lookup. bind(Object receiver, String name, MethodType type)Produces an early-bound method handle for a non-static method.static MethodHandleMethodHandles. empty(MethodType type)Produces a method handle of the requested type which ignores any arguments, does nothing, and returns a suitable default depending on the return type.static MethodHandleMethodHandles. exactInvoker(MethodType type)Produces a special invoker method handle which can be used to invoke any method handle of the given type, as if byinvokeExact.static MethodHandleMethodHandles. explicitCastArguments(MethodHandle target, MethodType newType)Produces a method handle which adapts the type of the given method handle to a new type by pairwise argument and return type conversion.MethodHandleMethodHandles.Lookup. findConstructor(Class<?> refc, MethodType type)Produces a method handle which creates an object and initializes it, using the constructor of the specified type.MethodHandleMethodHandles.Lookup. findSpecial(Class<?> refc, String name, MethodType type, Class<?> specialCaller)Produces an early-bound method handle for a virtual method.MethodHandleMethodHandles.Lookup. findStatic(Class<?> refc, String name, MethodType type)Produces a method handle for a static method.MethodHandleMethodHandles.Lookup. findVirtual(Class<?> refc, String name, MethodType type)Produces a method handle for a virtual method.static MethodHandleMethodHandles. invoker(MethodType type)Produces a special invoker method handle which can be used to invoke any method handle compatible with the given type, as if byinvoke.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 invokedName, MethodType invokedType, MethodType samMethodType, MethodHandle implMethod, MethodType instantiatedMethodType)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 MethodTypeMethodType. methodType(Class<?> rtype, MethodType ptypes)Finds or creates a method type with the given components.static MethodHandleMethodHandles. permuteArguments(MethodHandle target, MethodType newType, int... reorder)Produces a method handle which adapts the calling sequence of the given method handle to a new type, by reordering the arguments.static MethodHandleMethodHandles. spreadInvoker(MethodType type, int leadingArgCount)Produces a method handle which will invoke any method handle of the giventype, with a given number of trailing arguments replaced by a single trailingObject[]array.static StringMethodHandleInfo. toString(int kind, Class<?> defc, String name, MethodType type)Returns a string representation for aMethodHandleInfo, given the four parts of its symbolic reference.static MethodHandleMethodHandles. varHandleExactInvoker(VarHandle.AccessMode accessMode, MethodType type)Produces a special invoker method handle which can be used to invoke a signature-polymorphic access mode method on any VarHandle whose associated access mode type is compatible with the given type.static MethodHandleMethodHandles. varHandleInvoker(VarHandle.AccessMode accessMode, MethodType type)Produces a special invoker method handle which can be used to invoke a signature-polymorphic access mode method on any VarHandle whose associated access mode type is compatible with the given type.Constructors in java.lang.invoke with parameters of type MethodType Constructor Description ConstantCallSite(MethodType targetType, MethodHandle createTargetHook)Creates a call site with a permanent target, possibly bound to the call site itself.MutableCallSite(MethodType type)Creates a blank call site object with the given method type.VolatileCallSite(MethodType type)Creates a call site with a volatile binding to its target. -
Uses of MethodType in jdk.dynalink
Methods in jdk.dynalink that return MethodType Modifier and Type Method Description MethodTypeCallSiteDescriptor. getMethodType()The type of the method at the call site.Methods in jdk.dynalink with parameters of type MethodType Modifier and Type Method Description CallSiteDescriptorCallSiteDescriptor. changeMethodType(MethodType newMethodType)Finds or creates a call site descriptor that only differs in its method type from this descriptor.protected CallSiteDescriptorCallSiteDescriptor. changeMethodTypeInternal(MethodType newMethodType)Finds or creates a call site descriptor that only differs in its method type from this descriptor.Constructors in jdk.dynalink with parameters of type MethodType Constructor Description CallSiteDescriptor(MethodHandles.Lookup lookup, Operation operation, MethodType methodType)Creates a new call site descriptor. -
Uses of MethodType in jdk.dynalink.linker
Methods in jdk.dynalink.linker with parameters of type MethodType Modifier and Type Method Description GuardedInvocationGuardedInvocation. asType(MethodType newType)Changes the type of the invocation, as ifMethodHandle.asType(MethodType)was applied to its invocation and its guard, if it has one (with return type changed to boolean, and parameter count potentially truncated for the guard).GuardedInvocationGuardedInvocation. asType(LinkerServices linkerServices, MethodType newType)Changes the type of the invocation, as ifLinkerServices.asType(MethodHandle, MethodType)was applied to its invocation and its guard, if it has one (with return type changed to boolean, and parameter count potentially truncated for the guard).MethodHandleLinkerServices. asType(MethodHandle handle, MethodType fromType)Similar toMethodHandle.asType(MethodType)except it also hooks in method handles produced by all availableGuardingTypeConverterFactoryimplementations, providing for language-specific type coercing of parameters.MethodHandleMethodTypeConversionStrategy. asType(MethodHandle target, MethodType newType)Converts a method handle to a new type.default MethodHandleLinkerServices. asTypeLosslessReturn(MethodHandle handle, MethodType fromType)Similar toLinkerServices.asType(MethodHandle, MethodType)except it treats return value type conversion specially.GuardedInvocationGuardedInvocation. asTypeSafeReturn(LinkerServices linkerServices, MethodType newType)Changes the type of the invocation, as ifLinkerServices.asTypeLosslessReturn(MethodHandle, MethodType)was applied to its invocation andLinkerServices.asType(MethodHandle, MethodType)applied to its guard, if it has one (with return type changed to boolean, and parameter count potentially truncated for the guard). -
Uses of MethodType in jdk.dynalink.linker.support
Methods in jdk.dynalink.linker.support with parameters of type MethodType Modifier and Type Method Description static MethodHandleGuards. asType(MethodHandle test, MethodType type)Takes a method handle intended to be used as a guard, and adapts it to the requested type, but returning a boolean.static MethodHandleGuards. asType(LinkerServices linkerServices, MethodHandle test, MethodType type)Takes a method handle intended to be used as a guard, and adapts it to the requested type, but returning a boolean.MethodHandleLookup. findSpecial(Class<?> declaringClass, String name, MethodType type)Performs aMethodHandles.Lookup.findSpecial(Class, String, MethodType, Class)on the underlying lookup.MethodHandleLookup. findStatic(Class<?> declaringClass, String name, MethodType type)Performs aMethodHandles.Lookup.findStatic(Class, String, MethodType)on the underlying lookup.MethodHandleLookup. findVirtual(Class<?> declaringClass, String name, MethodType type)Performs aMethodHandles.Lookup.findVirtual(Class, String, MethodType)on the underlying lookup.static MethodHandleGuards. isArray(int pos, MethodType type)Creates a method handle that returns true if the argument in the specified position is a Java array.static MethodHandleGuards. isInstance(Class<?> clazz, int pos, MethodType type)Creates a method handle with arguments of a specified type, but with boolean return value.static MethodHandleGuards. isInstance(Class<?> clazz, MethodType type)Creates a method handle with arguments of a specified type, but with boolean return value.static MethodHandleGuards. isOfClass(Class<?> clazz, MethodType type)Creates a guard method handle with arguments of a specified type, but with boolean return value.
-