Reflecting
Reflecting a constructor by arguments (will return null if not found):
Class<T> clazz;
Constructor<T> c = new Mirror().on(clazz).reflect().constructor()
.withArgs(String.class, Object.class);
Reflecting the only constructor of a class (will throw MirrorException if more than one is found):
Class<T> clazz;
Constructor<T> m = new Mirror().on(clazz).reflect().constructor().withAnyArgs();
Reflecting all constructors of a class (will return an empty list if none found):
Class<T> clazz;
List<Constructor<T>> l = new Mirror().on(clazz).reflectAll().constructors();
Reflecting all constructors of a class that matches a Matcher<Constructor> (will return an empty list if none found):
Class<T> clazz;
List<Constructor<T>> l = new Mirror().on(clazz).reflectAll()
.constructors().matching(new YourCustomMatcher());
You can also map your constructors to other types:
Class clazz;
List<String> l = new Mirror().on(clazz).reflectAll()
.constructors().mappingTo(new YourConstructorToStringMapper());