/** * Returns a {@link List} of {@link ConstructorSub}s for each * constructor declared constructor in the inspected class. However, * in safe mode (which *is* the default), this will only return * the public constructors. You must configure safe mode to be off * to receive a list of all constructors. * @return constructors inspectors list */ public List<ConstructorSub> getConstructors() { if (constructors == null) { Constructor[] declared = getType().getDeclaredConstructors(); List<ConstructorSub> subs = new ArrayList<ConstructorSub>(declared.length); for (Constructor constructor : declared) { ConstructorSub sub = new ConstructorSub(constructor); if ((!isSafeMode() || sub.isPublic()) && (showDeprecated || !sub.isDeprecated())) { subs.add(sub); } } Collections.sort(subs); constructors = Collections.unmodifiableList(subs); } return constructors; }
if (!isSafeMode() || constructor.isPublic()) for (Class type : constructor.getParameters())