/** * Method that can be called to locate a single-arg constructor that takes specified exact type * (will not accept supertype constructors) * * @param argTypes Type(s) of the argument that we are looking for */ public Constructor<?> findSingleArgConstructor(Class<?>... argTypes) { for (AnnotatedConstructor ac : _classInfo.getConstructors()) { // This list is already filtered to only include accessible /* (note: for now this is a redundant check; but in future * that may change; thus leaving here for now) */ if (ac.getParameterCount() == 1) { Class<?> actArg = ac.getParameterClass(0); for (Class<?> expArg : argTypes) { if (expArg == actArg) { return ac.getAnnotated(); } } } } return null; }
public List<AnnotatedConstructor> getConstructors() { return _classInfo.getConstructors(); }