Tabnine Logo
Reflects.findMatchingParameterTypes
Code IndexAdd Tabnine to your IDE (free)

How to use
findMatchingParameterTypes
method
in
org.jupiter.common.util.Reflects

Best Java code snippets using org.jupiter.common.util.Reflects.findMatchingParameterTypes (Showing top 4 results out of 315)

origin: fengjiachun/Jupiter

  private static RegistryServer newInstance(Object... parameters) {
    if (defaultRegistryClass == null || allConstructorsParameterTypes == null) {
      throw new UnsupportedOperationException("Unsupported default registry");
    }
    // 根据JLS方法调用的静态分派规则查找最匹配的方法parameterTypes
    Class<?>[] parameterTypes = Reflects.findMatchingParameterTypes(allConstructorsParameterTypes, parameters);
    if (parameterTypes == null) {
      throw new IllegalArgumentException("Parameter types");
    }
    try {
      @SuppressWarnings("JavaReflectionMemberAccess")
      Constructor<RegistryServer> c = defaultRegistryClass.getConstructor(parameterTypes);
      c.setAccessible(true);
      return c.newInstance(parameters);
    } catch (Exception e) {
      ThrowUtil.throwException(e);
    }
    return null; // should never get here
  }
}
origin: fengjiachun/Jupiter

  private static RegistryServer newInstance(Object... parameters) {
    if (defaultRegistryClass == null || allConstructorsParameterTypes == null) {
      throw new UnsupportedOperationException("Unsupported default registry");
    }
    // 根据JLS方法调用的静态分派规则查找最匹配的方法parameterTypes
    Class<?>[] parameterTypes = Reflects.findMatchingParameterTypes(allConstructorsParameterTypes, parameters);
    if (parameterTypes == null) {
      throw new IllegalArgumentException("Parameter types");
    }
    try {
      @SuppressWarnings("JavaReflectionMemberAccess")
      Constructor<RegistryServer> c = defaultRegistryClass.getConstructor(parameterTypes);
      c.setAccessible(true);
      return c.newInstance(parameters);
    } catch (Exception e) {
      ThrowUtil.throwException(e);
    }
    return null; // should never get here
  }
}
origin: org.jupiter-rpc/jupiter-registry-api

  private static RegistryServer newInstance(Object... parameters) {
    if (defaultRegistryClass == null || allConstructorsParameterTypes == null) {
      throw new UnsupportedOperationException("Unsupported default registry");
    }
    // 根据JLS方法调用的静态分派规则查找最匹配的方法parameterTypes
    Class<?>[] parameterTypes = Reflects.findMatchingParameterTypes(allConstructorsParameterTypes, parameters);
    if (parameterTypes == null) {
      throw new IllegalArgumentException("Parameter types");
    }
    try {
      @SuppressWarnings("JavaReflectionMemberAccess")
      Constructor<RegistryServer> c = defaultRegistryClass.getConstructor(parameterTypes);
      c.setAccessible(true);
      return c.newInstance(parameters);
    } catch (Exception e) {
      ThrowUtil.throwException(e);
    }
    return null; // should never get here
  }
}
origin: org.jupiter-rpc/jupiter-all

  private static RegistryServer newInstance(Object... parameters) {
    if (defaultRegistryClass == null || allConstructorsParameterTypes == null) {
      throw new UnsupportedOperationException("Unsupported default registry");
    }
    // 根据JLS方法调用的静态分派规则查找最匹配的方法parameterTypes
    Class<?>[] parameterTypes = Reflects.findMatchingParameterTypes(allConstructorsParameterTypes, parameters);
    if (parameterTypes == null) {
      throw new IllegalArgumentException("Parameter types");
    }
    try {
      @SuppressWarnings("JavaReflectionMemberAccess")
      Constructor<RegistryServer> c = defaultRegistryClass.getConstructor(parameterTypes);
      c.setAccessible(true);
      return c.newInstance(parameters);
    } catch (Exception e) {
      ThrowUtil.throwException(e);
    }
    return null; // should never get here
  }
}
org.jupiter.common.utilReflectsfindMatchingParameterTypes

Javadoc

Find an array of parameter Types that matches the given compatible parameters.

Popular methods of Reflects

  • simpleClassName
    The shortcut to #simpleClassName(Class).
  • compareParameterTypes
    Compares the relative fitness of two sets of parameter types in terms of matching a third set of run
  • fastInvoke
    Invokes the underlying method, fast invoke using ASM.
  • findMatchingParameterTypesExt
    Find an array of parameter Types that matches the given compatible parameters.
  • getField
    Returns a Field object that reflects the specified declared field of the Class or interface represen
  • getObjectTransformationCost
    Gets the number of steps required needed to turn the source class into the destination class. This r
  • getPrimitivePromotionCost
    Gets the number of steps required to promote a primitive number to another type.
  • getTotalTransformationCost
    Returns the sum of the object transformation cost for each class in the source argument list.
  • getTypeDefaultValue
  • isAssignable
    Checks if an array of Classes can be assigned to another array of Classes.
  • primitiveToWrapper
    Converts the specified primitive Class object to its corresponding wrapper Class object.
  • setAccessible
    Set the accessible flag for this object to the indicated boolean value. A value of true indicates th
  • primitiveToWrapper,
  • setAccessible,
  • wrapperToPrimitive,
  • getStaticValue

Popular in Java

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • scheduleAtFixedRate (Timer)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now