Class JavaConstant.MethodHandle.Dispatcher.AbstractBase

    • Field Detail

      • NO_ARGUMENTS

        private static final java.lang.Object[] NO_ARGUMENTS
        An empty array that can be used to indicate no arguments to avoid an allocation on a reflective call.
      • publicLookup

        protected final java.lang.reflect.Method publicLookup
        A reference to java.lang.invoke.MethodHandles#publicLookup.
      • getName

        protected final java.lang.reflect.Method getName
        A reference to java.lang.invoke.MethodHandleInfo#getName.
      • getDeclaringClass

        protected final java.lang.reflect.Method getDeclaringClass
        A reference to java.lang.invoke.MethodHandleInfo#getDeclaringClass.
      • getReferenceKind

        protected final java.lang.reflect.Method getReferenceKind
        A reference to java.lang.invoke.MethodHandleInfo#getReferenceKind.
      • getMethodType

        protected final java.lang.reflect.Method getMethodType
        A reference to java.lang.invoke.MethodHandleInfo#getMethodType.
      • returnType

        protected final java.lang.reflect.Method returnType
        A reference to java.lang.invoke.MethodType#returnType.
      • parameterArray

        protected final java.lang.reflect.Method parameterArray
        A reference to java.lang.invoke.MethodType#parameterArray.
      • lookupClass

        protected final java.lang.reflect.Method lookupClass
        A reference to java.lang.invoke.MethodHandles$Lookup#lookupClass method.
    • Constructor Detail

      • AbstractBase

        protected AbstractBase​(java.lang.reflect.Method publicLookup,
                               java.lang.reflect.Method getName,
                               java.lang.reflect.Method getDeclaringClass,
                               java.lang.reflect.Method getReferenceKind,
                               java.lang.reflect.Method getMethodType,
                               java.lang.reflect.Method returnType,
                               java.lang.reflect.Method parameterArray,
                               java.lang.reflect.Method lookupClass)
        Creates a legal dispatcher.
        Parameters:
        publicLookup - A reference to java.lang.invoke.MethodHandles#publicLookup.
        getName - A reference to java.lang.invoke.MethodHandleInfo#getName.
        getDeclaringClass - A reference to java.lang.invoke.MethodHandleInfo#getDeclaringClass.
        getReferenceKind - A reference to java.lang.invoke.MethodHandleInfo#getReferenceKind.
        getMethodType - A reference to java.lang.invoke.MethodHandleInfo#getMethodType.
        returnType - A reference to java.lang.invoke.MethodType#returnType.
        parameterArray - A reference to java.lang.invoke.MethodType#parameterArray.
        lookupClass - A reference to java.lang.invoke.MethodHandles$Lookup#lookupClass method.
    • Method Detail

      • getMethodType

        public java.lang.Object getMethodType​(java.lang.Object methodHandleInfo)
        Returns a method handle info's method type.
        Specified by:
        getMethodType in interface JavaConstant.MethodHandle.Dispatcher
        Parameters:
        methodHandleInfo - The method handle info to introspect.
        Returns:
        The java.lang.invoke.MethodType instance representing the method handle's type.
      • getReferenceKind

        public int getReferenceKind​(java.lang.Object methodHandleInfo)
        Returns the reference kind of the supplied method handle info.
        Specified by:
        getReferenceKind in interface JavaConstant.MethodHandle.Dispatcher
        Parameters:
        methodHandleInfo - The method handle to be introspected.
        Returns:
        The method handle info's reference type.
      • getDeclaringClass

        public java.lang.Class<?> getDeclaringClass​(java.lang.Object methodHandleInfo)
        Returns the declaring class of the supplied method handle info.
        Specified by:
        getDeclaringClass in interface JavaConstant.MethodHandle.Dispatcher
        Parameters:
        methodHandleInfo - The method handle to be introspected.
        Returns:
        The method handle info's declaring class.
      • getName

        public java.lang.String getName​(java.lang.Object methodHandleInfo)
        Returns the method name of the supplied method handle info.
        Specified by:
        getName in interface JavaConstant.MethodHandle.Dispatcher
        Parameters:
        methodHandleInfo - The method handle to be introspected.
        Returns:
        The method handle info's method name.
      • returnType

        public java.lang.Class<?> returnType​(java.lang.Object methodType)
        Returns the return type of the supplied method type.
        Specified by:
        returnType in interface JavaConstant.MethodHandle.Dispatcher
        Parameters:
        methodType - The method type to be introspected.
        Returns:
        The method type's return type.
      • parameterArray

        public java.util.List<? extends java.lang.Class<?>> parameterArray​(java.lang.Object methodType)
        Returns the parameter types of the supplied method type.
        Specified by:
        parameterArray in interface JavaConstant.MethodHandle.Dispatcher
        Parameters:
        methodType - The method type to be introspected.
        Returns:
        The method type's parameter types.
      • lookupType

        public java.lang.Class<?> lookupType​(java.lang.Object lookup)
        Returns the lookup type of a given java.lang.invoke.MethodHandles$Lookup instance.
        Specified by:
        lookupType in interface JavaConstant.MethodHandle.Dispatcher.Initializable
        Parameters:
        lookup - A java.lang.invoke.MethodHandles$Lookup instance.
        Returns:
        The provided instance's lookup type.