/** * Finds the public constructor that can take in the specified arguments. * * @param c The class we're trying to construct. * @param args The argument types we want to pass into the constructor. * @return * The constructor, or <jk>null</jk> if a public constructor could not be found that takes in the specified * arguments. */ public static <T> Constructor<T> findPublicConstructor(Class<T> c, Class<?>...args) { return findPublicConstructor(c, false, args); }
/** * Finds the public constructor that can take in the specified arguments. * * @param c The class we're trying to construct. * @param args The argument types we want to pass into the constructor. * @return * The constructor, or <jk>null</jk> if a public constructor could not be found that takes in the specified * arguments. */ public static <T> Constructor<T> findPublicConstructor(Class<T> c, Class<?>...args) { return findPublicConstructor(c, false, args); }
/** * Finds the public constructor that can take in the specified arguments. * * @param c The class we're trying to construct. * @param args The argument types we want to pass into the constructor. * @return * The constructor, or <jk>null</jk> if a public constructor could not be found that takes in the specified * arguments. */ public static <T> Constructor<T> findPublicConstructor(Class<T> c, Class<?>...args) { return findPublicConstructor(c, false, args); }
private void doThrow(Class<?> t, String msg) throws Throwable { Constructor<?> c = null; if (msg != null) { c = findPublicConstructor(t, String.class); if (c != null) throw (Throwable)c.newInstance(msg); c = findPublicConstructor(t, Object.class); if (c != null) throw (Throwable)c.newInstance(msg); } c = findPublicConstructor(t); if (c != null) throw (Throwable)c.newInstance(); }
private void doThrow(Class<?> t, String msg) throws Throwable { Constructor<?> c = null; if (msg != null) { c = findPublicConstructor(t, String.class); if (c != null) throw (Throwable)c.newInstance(msg); c = findPublicConstructor(t, Object.class); if (c != null) throw (Throwable)c.newInstance(msg); } c = findPublicConstructor(t); if (c != null) throw (Throwable)c.newInstance(); }
private void doThrow(Class<?> t, String msg) throws Throwable { Constructor<?> c = null; if (msg != null) { c = findPublicConstructor(t, String.class); if (c != null) throw (Throwable)c.newInstance(msg); c = findPublicConstructor(t, Object.class); if (c != null) throw (Throwable)c.newInstance(msg); } c = findPublicConstructor(t); if (c != null) throw (Throwable)c.newInstance(); }
/** * Finds the public constructor that can take in the specified arguments. * * @param c The class we're trying to construct. * @param args The arguments we want to pass into the constructor. * @return * The constructor, or <jk>null</jk> if a public constructor could not be found that takes in the specified * arguments. */ public static <T> Constructor<T> findPublicConstructor(Class<T> c, Object...args) { return findPublicConstructor(c, false, getClasses(args)); }
/** * Finds the public constructor that can take in the specified arguments. * * @param c The class we're trying to construct. * @param args The arguments we want to pass into the constructor. * @return * The constructor, or <jk>null</jk> if a public constructor could not be found that takes in the specified * arguments. */ public static <T> Constructor<T> findPublicConstructor(Class<T> c, Object...args) { return findPublicConstructor(c, false, getClasses(args)); }
/** * Finds the public constructor that can take in the specified arguments. * * @param c The class we're trying to construct. * @param args The arguments we want to pass into the constructor. * @return * The constructor, or <jk>null</jk> if a public constructor could not be found that takes in the specified * arguments. */ public static <T> Constructor<T> findPublicConstructor(Class<T> c, Object...args) { return findPublicConstructor(c, false, getClasses(args)); }
/** * Finds the public constructor that can take in the specified arguments. * * @param c The class we're trying to construct. * @param fuzzyArgs * Use fuzzy-arg matching. * Find a constructor that best matches the specified args. * @param args The arguments we want to pass into the constructor. * @return * The constructor, or <jk>null</jk> if a public constructor could not be found that takes in the specified * arguments. */ public static <T> Constructor<T> findPublicConstructor(Class<T> c, boolean fuzzyArgs, Object...args) { return findPublicConstructor(c, fuzzyArgs, getClasses(args)); }
/** * Finds the public constructor that can take in the specified arguments. * * @param c The class we're trying to construct. * @param fuzzyArgs * Use fuzzy-arg matching. * Find a constructor that best matches the specified args. * @param args The arguments we want to pass into the constructor. * @return * The constructor, or <jk>null</jk> if a public constructor could not be found that takes in the specified * arguments. */ public static <T> Constructor<T> findPublicConstructor(Class<T> c, boolean fuzzyArgs, Object...args) { return findPublicConstructor(c, fuzzyArgs, getClasses(args)); }
/** * Finds the public constructor that can take in the specified arguments. * * @param c The class we're trying to construct. * @param fuzzyArgs * Use fuzzy-arg matching. * Find a constructor that best matches the specified args. * @param args The arguments we want to pass into the constructor. * @return * The constructor, or <jk>null</jk> if a public constructor could not be found that takes in the specified * arguments. */ public static <T> Constructor<T> findPublicConstructor(Class<T> c, boolean fuzzyArgs, Object...args) { return findPublicConstructor(c, fuzzyArgs, getClasses(args)); }
Constructor<?> con = findPublicConstructor(c3, false, args); if (con != null) return (T)con.newInstance(args); con = findPublicConstructor(c3, false, args); if (con != null) return (T)con.newInstance(args); con = findPublicConstructor(c3, true, args); if (con != null) return (T)con.newInstance(getMatchingArgs(con.getParameterTypes(), args));
Constructor<?> con = findPublicConstructor(c3, false, args); if (con != null) return (T)con.newInstance(args); con = findPublicConstructor(c3, false, args); if (con != null) return (T)con.newInstance(args); con = findPublicConstructor(c3, true, args); if (con != null) return (T)con.newInstance(getMatchingArgs(con.getParameterTypes(), args));
Constructor<?> con = findPublicConstructor(c3, false, args); if (con != null) return (T)con.newInstance(args); con = findPublicConstructor(c3, false, args); if (con != null) return (T)con.newInstance(args); con = findPublicConstructor(c3, true, args); if (con != null) return (T)con.newInstance(getMatchingArgs(con.getParameterTypes(), args));
final Constructor<?> c = findPublicConstructor(oc, ic); final boolean isMemberClass = oc.isMemberClass() && ! isStatic(oc); if (c != null && ! isDeprecated(c)) {
final Constructor<?> c = findPublicConstructor(oc, ic); final boolean isMemberClass = oc.isMemberClass() && ! isStatic(oc); if (c != null && ! isDeprecated(c)) {
final Constructor<?> c = findPublicConstructor(oc, ic); final boolean isMemberClass = oc.isMemberClass() && ! isStatic(oc); if (c != null && ! isDeprecated(c)) {