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.invoke
package provides low-level primitives for interacting with the Java Virtual Machine.jdk.dynalink Contains interfaces and classes that are used to link aninvokedynamic
call 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 MethodType
StackWalker.StackFrame. getMethodType()
-
Uses of MethodType in java.lang.invoke
Methods in java.lang.invoke that return MethodType Modifier and Type Method Description MethodType
VarHandle. accessModeType(VarHandle.AccessMode accessMode)
EachVarHandle.AccessMode
, e.g. get and set, requires different parameters in addition to thecoordinateTypes()
.MethodType
MethodType. appendParameterTypes(Class<?>... classes)
Returns a MethodType with the additional class types appended to the end.MethodType
MethodType. appendParameterTypes(List<Class<?>> classes)
Returns a MethodType with the additional class types appended to the end.MethodType
MethodType. changeParameterType(int position, Class<?> type)
Convenience method to create a new MethodType with only the parameter at position changed to the new type.MethodType
MethodType. changeReturnType(Class<?> type)
Convenience method to create a new MethodType with a changed return type.MethodType
MethodType. dropParameterTypes(int startPosition, int endPosition)
Convenience method to create a new MethodType after dropping the parameters between startPosition and endPosition.MethodType
MethodType. erase()
Convenience method erase all reference types to Object.static MethodType
MethodType. fromMethodDescriptorString(String methodDescriptor, ClassLoader loader)
Convenience Method to create a MethodType from bytecode-level method descriptor.MethodType
MethodType. generic()
Convenience method to convert all types to Object.static MethodType
MethodType. genericMethodType(int numParameters)
Static helper method to create a MethodType with only Object return type and parameters.static MethodType
MethodType. genericMethodType(int numParameters, boolean isVarargs)
Wrapper onmethodType(Class, Class[])
.MethodType
MethodHandleInfo. getMethodType()
Returns the type of the MethodHandle's underlying member as a MethodType.MethodType
MethodType. insertParameterTypes(int position, Class<?>... types)
Return a new MethodType with an additional parameters inserted at position, which is a zero based index.MethodType
MethodType. insertParameterTypes(int position, List<Class<?>> types)
Return a new MethodType with an additional parameters inserted at position, which is a zero based index.static MethodType
MethodType. methodType(Class<?> type)
Create a MethodType object with the specified return type and no parametersstatic MethodType
MethodType. methodType(Class<?> type, Class<?> parameter0)
Return a MethodType object with the specified return type and a single parameter of type 'parameter0'.static MethodType
MethodType. methodType(Class<?> returnType, Class<?>[] parameters)
Return a MethodType object with the parameter and return types as requested.static MethodType
MethodType. methodType(Class<?> type, Class<?> parameter0, Class<?>... parameters)
Wrapper onmethodType(Class, Class[])
.static MethodType
MethodType. methodType(Class<?> returnType, MethodType methodType)
Wrapper onmethodType(Class, Class[])
.static MethodType
MethodType. methodType(Class<?> type, List<Class<?>> parameters)
Wrapper onmethodType(Class, Class[])
MethodType
CallSite. type()
Report the type of CallSite's target MethodHandle.MethodType
MethodHandle. type()
The MethodType of the MethodHandle.MethodType
MethodType. unwrap()
Wrapper method onmethodType(Class, Class[])
.MethodType
MethodType. wrap()
Wrapper method onmethodType(Class, Class[])
.Methods in java.lang.invoke with parameters of type MethodType Modifier and Type Method Description static CallSite
LambdaMetafactory. 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.MethodHandle
MethodHandle. asType(MethodType newType)
Returns a MethodHandle that presents as being of MethodType newType.MethodHandle
MethodHandles.Lookup. bind(Object receiver, String methodName, MethodType type)
Return an early-bound method handle to a non-static method.static MethodHandle
MethodHandles. empty(MethodType targetMethodType)
Produces a constant method handle that ignores arguments and returns the default value for the return type of the requested MethodType.static MethodHandle
MethodHandles. exactInvoker(MethodType type)
Return a MethodHandle that is the equivalent of calling MethodHandles.lookup().findVirtual(MethodHandle.class, "invokeExact", type).static MethodHandle
MethodHandles. explicitCastArguments(MethodHandle handle, MethodType type)
Produce an adapter that converts the incoming arguments from type to the underlying MethodHandle's type and converts the return value as required.MethodHandle
MethodHandles.Lookup. findConstructor(Class<?> declaringClass, MethodType type)
Return a MethodHandle that will create an object of the required class and initialize it using the constructor method with signature type.MethodHandle
MethodHandles.Lookup. findSpecial(Class<?> clazz, String methodName, MethodType type, Class<?> specialToken)
Return a MethodHandle bound to a specific-implementation of a virtual method, as if created by an invokespecial bytecode using the class specialToken.MethodHandle
MethodHandles.Lookup. findStatic(Class<?> clazz, String methodName, MethodType type)
Return a MethodHandle to a static method.MethodHandle
MethodHandles.Lookup. findVirtual(Class<?> clazz, String methodName, MethodType type)
Return a MethodHandle to a virtual method.static MethodHandle
MethodHandles. invoker(MethodType type)
Return a MethodHandle that is the equivalent of calling MethodHandles.lookup().findVirtual(MethodHandle.class, "invoke", type).static CallSite
StringConcatFactory. 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 CallSite
StringConcatFactory. 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 CallSite
LambdaMetafactory. 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 MethodType
MethodType. methodType(Class<?> returnType, MethodType methodType)
Wrapper onmethodType(Class, Class[])
.static MethodHandle
MethodHandles. permuteArguments(MethodHandle handle, MethodType permuteType, int... permute)
Produce a MethodHandle that will permute the incoming arguments according to the permute array.static MethodHandle
MethodHandles. spreadInvoker(MethodType type, int fixedArgCount)
Return a MethodHandle that is able to invoke a MethodHandle of type as though by invoke after spreading the final Object[] parameter.static String
MethodHandleInfo. toString(int kind, Class<?> defc, String name, MethodType type)
Answers a string containing a concise, human-readable description of the receiver.static MethodHandle
MethodHandles. varHandleExactInvoker(VarHandle.AccessMode accessMode, MethodType expectedType)
static MethodHandle
MethodHandles. varHandleInvoker(VarHandle.AccessMode accessMode, MethodType expectedType)
Constructors in java.lang.invoke with parameters of type MethodType Constructor Description ConstantCallSite(MethodType targetType, MethodHandle hook)
Create a ConstantCallSite and assign the hook MethodHandle's result to its permanent target.MutableCallSite(MethodType type)
Create a MutableCallSite with the MethodType type and an initial target that throws IllegalStateException.VolatileCallSite(MethodType type)
Create a VolatileCallSite with the MethodType type and an initial target that throws IllegalStateException. -
Uses of MethodType in jdk.dynalink
Methods in jdk.dynalink that return MethodType Modifier and Type Method Description MethodType
CallSiteDescriptor. getMethodType()
The type of the method at the call site.Methods in jdk.dynalink with parameters of type MethodType Modifier and Type Method Description CallSiteDescriptor
CallSiteDescriptor. changeMethodType(MethodType newMethodType)
Finds or creates a call site descriptor that only differs in its method type from this descriptor.protected CallSiteDescriptor
CallSiteDescriptor. 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 GuardedInvocation
GuardedInvocation. 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).GuardedInvocation
GuardedInvocation. 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).MethodHandle
LinkerServices. asType(MethodHandle handle, MethodType fromType)
Similar toMethodHandle.asType(MethodType)
except it also hooks in method handles produced by all availableGuardingTypeConverterFactory
implementations, providing for language-specific type coercing of parameters.MethodHandle
MethodTypeConversionStrategy. asType(MethodHandle target, MethodType newType)
Converts a method handle to a new type.default MethodHandle
LinkerServices. asTypeLosslessReturn(MethodHandle handle, MethodType fromType)
Similar toLinkerServices.asType(MethodHandle, MethodType)
except it treats return value type conversion specially.GuardedInvocation
GuardedInvocation. 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 MethodHandle
Guards. 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 MethodHandle
Guards. 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.MethodHandle
Lookup. findSpecial(Class<?> declaringClass, String name, MethodType type)
Performs aMethodHandles.Lookup.findSpecial(Class, String, MethodType, Class)
on the underlying lookup.MethodHandle
Lookup. findStatic(Class<?> declaringClass, String name, MethodType type)
Performs aMethodHandles.Lookup.findStatic(Class, String, MethodType)
on the underlying lookup.MethodHandle
Lookup. findVirtual(Class<?> declaringClass, String name, MethodType type)
Performs aMethodHandles.Lookup.findVirtual(Class, String, MethodType)
on the underlying lookup.static MethodHandle
Guards. isArray(int pos, MethodType type)
Creates a method handle that returns true if the argument in the specified position is a Java array.static MethodHandle
Guards. isInstance(Class<?> clazz, int pos, MethodType type)
Creates a method handle with arguments of a specified type, but with boolean return value.static MethodHandle
Guards. isInstance(Class<?> clazz, MethodType type)
Creates a method handle with arguments of a specified type, but with boolean return value.static MethodHandle
Guards. isOfClass(Class<?> clazz, MethodType type)
Creates a guard method handle with arguments of a specified type, but with boolean return value.
-