Class JavaConstant.MethodType.Dispatcher.ForJava7CapableVm

    • 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.
      • returnType

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

        private final java.lang.reflect.Method parameterArray
        A reference to java.lang.invoke.MethodType#returnType.
    • Constructor Detail

      • ForJava7CapableVm

        protected ForJava7CapableVm​(java.lang.reflect.Method returnType,
                                    java.lang.reflect.Method parameterArray)
        Creates a new dispatcher for a modern JVM.
        Parameters:
        returnType - A reference to java.lang.invoke.MethodType#returnType.
        parameterArray - A reference to java.lang.invoke.MethodType#returnType.
    • Method Detail

      • returnType

        public java.lang.Class<?> returnType​(java.lang.Object methodType)
        Extracts the return type of the supplied method type.
        Specified by:
        returnType in interface JavaConstant.MethodType.Dispatcher
        Parameters:
        methodType - An instance of java.lang.invoke.MethodType.
        Returns:
        The return type that is described by the supplied instance.
      • parameterArray

        public java.lang.Class<?>[] parameterArray​(java.lang.Object methodType)
        Extracts the parameter types of the supplied method type.
        Specified by:
        parameterArray in interface JavaConstant.MethodType.Dispatcher
        Parameters:
        methodType - An instance of java.lang.invoke.MethodType.
        Returns:
        The parameter types that are described by the supplied instance.