/** * Locates the no-arg constructor for the specified class. * * <p> * Constructor must match the visibility requirements specified by parameter 'v'. * If class is abstract, always returns <jk>null</jk>. * Note that this also returns the 1-arg constructor for non-static member classes. * * @param c The class from which to locate the no-arg constructor. * @param v The minimum visibility. * @return The constructor, or <jk>null</jk> if no no-arg constructor exists with the required visibility. */ @SuppressWarnings({"rawtypes","unchecked"}) public static final <T> Constructor<T> findNoArgConstructor(Class<T> c, Visibility v) { int mod = c.getModifiers(); if (Modifier.isAbstract(mod)) return null; boolean isMemberClass = c.isMemberClass() && ! isStatic(c); for (Constructor cc : c.getConstructors()) { mod = cc.getModifiers(); if (hasNumArgs(cc, isMemberClass ? 1 : 0) && v.isVisible(mod) && isNotDeprecated(cc)) return v.transform(cc); } return null; }
/** * Locates the no-arg constructor for the specified class. * * <p> * Constructor must match the visibility requirements specified by parameter 'v'. * If class is abstract, always returns <jk>null</jk>. * Note that this also returns the 1-arg constructor for non-static member classes. * * @param c The class from which to locate the no-arg constructor. * @param v The minimum visibility. * @return The constructor, or <jk>null</jk> if no no-arg constructor exists with the required visibility. */ @SuppressWarnings({"rawtypes","unchecked"}) public static final <T> Constructor<T> findNoArgConstructor(Class<T> c, Visibility v) { int mod = c.getModifiers(); if (Modifier.isAbstract(mod)) return null; boolean isMemberClass = c.isMemberClass() && ! isStatic(c); for (Constructor cc : c.getConstructors()) { mod = cc.getModifiers(); if (hasNumArgs(cc, isMemberClass ? 1 : 0) && v.isVisible(mod) && isNotDeprecated(cc)) return v.transform(cc); } return null; }
/** * Locates the no-arg constructor for the specified class. * * <p> * Constructor must match the visibility requirements specified by parameter 'v'. * If class is abstract, always returns <jk>null</jk>. * Note that this also returns the 1-arg constructor for non-static member classes. * * @param c The class from which to locate the no-arg constructor. * @param v The minimum visibility. * @return The constructor, or <jk>null</jk> if no no-arg constructor exists with the required visibility. */ @SuppressWarnings({"rawtypes","unchecked"}) public static final <T> Constructor<T> findNoArgConstructor(Class<T> c, Visibility v) { int mod = c.getModifiers(); if (Modifier.isAbstract(mod)) return null; boolean isMemberClass = c.isMemberClass() && ! isStatic(c); for (Constructor cc : c.getConstructors()) { mod = cc.getModifiers(); if (hasNumArgs(cc, isMemberClass ? 1 : 0) && v.isVisible(mod) && isNotDeprecated(cc)) return v.transform(cc); } return null; }
/** * Locates the no-arg constructor for the specified class. * * <p> * Constructor must match the visibility requirements specified by parameter 'v'. * If class is abstract, always returns <jk>null</jk>. * Note that this also returns the 1-arg constructor for non-static member classes. * * @param c The class from which to locate the no-arg constructor. * @param v The minimum visibility. * @return The constructor, or <jk>null</jk> if no no-arg constructor exists with the required visibility. */ @SuppressWarnings({"rawtypes","unchecked"}) protected static <T> Constructor<? extends T> findNoArgConstructor(Class<?> c, Visibility v) { if (ClassUtils.isAbstract(c)) return null; boolean isMemberClass = c.isMemberClass() && ! isStatic(c); for (Constructor cc : c.getConstructors()) { if (hasNumArgs(cc, isMemberClass ? 1 : 0) && v.isVisible(cc.getModifiers()) && isNotDeprecated(cc)) return v.transform(cc); } return null; }
/** * Locates the no-arg constructor for the specified class. * * <p> * Constructor must match the visibility requirements specified by parameter 'v'. * If class is abstract, always returns <jk>null</jk>. * Note that this also returns the 1-arg constructor for non-static member classes. * * @param c The class from which to locate the no-arg constructor. * @param v The minimum visibility. * @return The constructor, or <jk>null</jk> if no no-arg constructor exists with the required visibility. */ @SuppressWarnings({"rawtypes","unchecked"}) protected static <T> Constructor<? extends T> findNoArgConstructor(Class<?> c, Visibility v) { if (ClassUtils.isAbstract(c)) return null; boolean isMemberClass = c.isMemberClass() && ! isStatic(c); for (Constructor cc : c.getConstructors()) { if (hasNumArgs(cc, isMemberClass ? 1 : 0) && v.isVisible(cc.getModifiers()) && isNotDeprecated(cc)) return v.transform(cc); } return null; }
/** * Locates the no-arg constructor for the specified class. * * <p> * Constructor must match the visibility requirements specified by parameter 'v'. * If class is abstract, always returns <jk>null</jk>. * Note that this also returns the 1-arg constructor for non-static member classes. * * @param c The class from which to locate the no-arg constructor. * @param v The minimum visibility. * @return The constructor, or <jk>null</jk> if no no-arg constructor exists with the required visibility. */ @SuppressWarnings({"rawtypes","unchecked"}) protected static <T> Constructor<? extends T> findNoArgConstructor(Class<?> c, Visibility v) { if (ClassUtils.isAbstract(c)) return null; boolean isMemberClass = c.isMemberClass() && ! isStatic(c); for (Constructor cc : c.getConstructors()) { if (hasNumArgs(cc, isMemberClass ? 1 : 0) && v.isVisible(cc.getModifiers()) && isNotDeprecated(cc)) return v.transform(cc); } return null; }
final boolean isMemberClass = c.isMemberClass() && ! isStatic(c); for (Constructor<?> n : c.getConstructors()) { Class<?>[] paramTypes = n.getParameterTypes();
final boolean isMemberClass = c.isMemberClass() && ! isStatic(c); for (Constructor<?> n : c.getConstructors()) { Class<?>[] paramTypes = n.getParameterTypes();
final boolean isMemberClass = c.isMemberClass() && ! isStatic(c); for (Constructor<?> n : c.getConstructors()) { Class<?>[] paramTypes = n.getParameterTypes();
break; case STATIC: if (isStatic(x)) return true; break;
break; case STATIC: if (isStatic(x)) return true; break;
break; case STATIC: if (isStatic(x)) return true; break;
break; case NOT_STATIC: if (isStatic(x)) return false; break;
break; case NOT_STATIC: if (isStatic(x)) return false; break;
break; case STATIC: if (isStatic(x)) return true; break;
break; case STATIC: if (isStatic(x)) return true; break;
break; case NOT_STATIC: if (isStatic(x)) return false; break;
break; case NOT_STATIC: if (isStatic(x)) return false; break;
break; case NOT_STATIC: if (isStatic(x)) return false; break;
break; case STATIC: if (isStatic(x)) return true; break;