Search in sources :

Example 1 with DynamicFinder

use of com.google.inject.persist.finder.DynamicFinder in project guice by google.

the class JpaPersistModule method isDynamicFinderValid.

private boolean isDynamicFinderValid(Class<?> iface) {
    boolean valid = true;
    if (!iface.isInterface()) {
        addError(iface + " is not an interface. Dynamic Finders must be interfaces.");
        valid = false;
    }
    for (Method method : iface.getMethods()) {
        DynamicFinder finder = DynamicFinder.from(method);
        if (null == finder) {
            addError("Dynamic Finder methods must be annotated with @Finder, but " + iface + "." + method.getName() + " was not");
            valid = false;
        }
    }
    return valid;
}
Also used : DynamicFinder(com.google.inject.persist.finder.DynamicFinder) Method(java.lang.reflect.Method)

Example 2 with DynamicFinder

use of com.google.inject.persist.finder.DynamicFinder in project roboguice by roboguice.

the class JpaPersistModule method isDynamicFinderValid.

private boolean isDynamicFinderValid(Class<?> iface) {
    boolean valid = true;
    if (!iface.isInterface()) {
        addError(iface + " is not an interface. Dynamic Finders must be interfaces.");
        valid = false;
    }
    for (Method method : iface.getMethods()) {
        DynamicFinder finder = DynamicFinder.from(method);
        if (null == finder) {
            addError("Dynamic Finder methods must be annotated with @Finder, but " + iface + "." + method.getName() + " was not");
            valid = false;
        }
    }
    return valid;
}
Also used : DynamicFinder(com.google.inject.persist.finder.DynamicFinder) Method(java.lang.reflect.Method)

Aggregations

DynamicFinder (com.google.inject.persist.finder.DynamicFinder)2 Method (java.lang.reflect.Method)2