My solution for this:
private Set<Class<? extends JaxbContextPath>> findJaxbFactoryClasses() {
final Reflections reflections = new Reflections("com.acme.foo");
Set<Class<? extends JaxbContextPath>> classes = reflections.getSubTypesOf(JaxbContextPath.class);
//noinspection unchecked
classes = ReflectionUtils.getAll(classes, IS_CONCRETE_CLASS);
return classes;
}
and
private static final Predicate<? super Class<? extends JaxbContextPath>> IS_CONCRETE_CLASS = new Predicate<Class<? extends JaxbContextPath>>() {
@Override
public boolean apply(final Class<? extends JaxbContextPath> input) {
return !input.isInterface() && !Modifier.isAbstract(input.getModifiers());
}
};
but I still wonder, if there's a nicer way.