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() -
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)EachVarHandle.AccessMode, e.g. get and set, requires different parameters in addition to thecoordinateTypes().MethodTypeMethodType. appendParameterTypes(Class<?>... classes)Returns a MethodType with the additional class types appended to the end.MethodTypeMethodType. appendParameterTypes(List<Class<?>> classes)Returns a MethodType with the additional class types appended to the end.MethodTypeMethodType. changeParameterType(int position, Class<?> type)Convenience method to create a new MethodType with only the parameter at position changed to the new type.MethodTypeMethodType. changeReturnType(Class<?> type)Convenience method to create a new MethodType with a changed return type.MethodTypeMethodType. dropParameterTypes(int startPosition, int endPosition)Convenience method to create a new MethodType after dropping the parameters between startPosition and endPosition.MethodTypeMethodType. erase()Convenience method erase all reference types to Object.static MethodTypeMethodType. fromMethodDescriptorString(String methodDescriptor, ClassLoader loader)Convenience Method to create a MethodType from bytecode-level method descriptor.MethodTypeMethodType. generic()Convenience method to convert all types to Object.static MethodTypeMethodType. genericMethodType(int numParameters)Static helper method to create a MethodType with only Object return type and parameters.static MethodTypeMethodType. genericMethodType(int numParameters, boolean isVarargs)Wrapper onmethodType(Class, Class[]).MethodTypeMethodHandleInfo. getMethodType()Returns the type of the MethodHandle's underlying member as a MethodType.MethodTypeMethodType. insertParameterTypes(int position, Class<?>... types)Return a new MethodType with an additional parameters inserted at position, which is a zero based index.MethodTypeMethodType. insertParameterTypes(int position, List<Class<?>> types)Return a new MethodType with an additional parameters inserted at position, which is a zero based index.static MethodTypeMethodType. methodType(Class<?> type)Create a MethodType object with the specified return type and no parametersstatic MethodTypeMethodType. methodType(Class<?> type, Class<?> parameter0)Return a MethodType object with the specified return type and a single parameter of type 'parameter0'.static MethodTypeMethodType. methodType(Class<?> returnType, Class<?>[] parameters)Return a MethodType object with the parameter and return types as requested.static MethodTypeMethodType. methodType(Class<?> type, Class<?> parameter0, Class<?>... parameters)Wrapper onmethodType(Class, Class[]).static MethodTypeMethodType. methodType(Class<?> returnType, MethodType methodType)Wrapper onmethodType(Class, Class[]).static MethodTypeMethodType. methodType(Class<?> type, List<Class<?>> parameters)Wrapper onmethodType(Class, Class[])MethodTypeCallSite. type()Report the type of CallSite's target MethodHandle.MethodTypeMethodHandle. type()The MethodType of the MethodHandle.MethodTypeMethodType. unwrap()Wrapper method onmethodType(Class, Class[]).MethodTypeMethodType. wrap()Wrapper method onmethodType(Class, Class[]).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)Returns a MethodHandle that presents as being of MethodType newType.MethodHandleMethodHandles.Lookup. bind(Object receiver, String methodName, MethodType type)Return an early-bound method handle to a non-static method.static MethodHandleMethodHandles. 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 MethodHandleMethodHandles. exactInvoker(MethodType type)Return a MethodHandle that is the equivalent of calling MethodHandles.lookup().findVirtual(MethodHandle.class, "invokeExact", type).static MethodHandleMethodHandles. 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.MethodHandleMethodHandles.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.MethodHandleMethodHandles.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.MethodHandleMethodHandles.Lookup. findStatic(Class<?> clazz, String methodName, MethodType type)Return a MethodHandle to a static method.MethodHandleMethodHandles.Lookup. findVirtual(Class<?> clazz, String methodName, MethodType type)Return a MethodHandle to a virtual method.static MethodHandleMethodHandles. invoker(MethodType type)Return a MethodHandle that is the equivalent of calling MethodHandles.lookup().findVirtual(MethodHandle.class, "invoke", type).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<?> returnType, MethodType methodType)Wrapper onmethodType(Class, Class[]).static MethodHandleMethodHandles. permuteArguments(MethodHandle handle, MethodType permuteType, int... permute)Produce a MethodHandle that will permute the incoming arguments according to the permute array.static MethodHandleMethodHandles. 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 StringMethodHandleInfo. toString(int kind, Class<?> defc, String name, MethodType type)Answers a string containing a concise, human-readable description of the receiver.static MethodHandleMethodHandles. varHandleExactInvoker(VarHandle.AccessMode accessMode, MethodType expectedType)static MethodHandleMethodHandles. 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 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.
-