/** * Creates a new finder instance based on the "targetClass" property. * * @param targetClass * The target Resource class to attach. * @return The new finder instance. */ protected Finder createFinder(Class<? extends Resource> targetClass) { Finder result = null; if (getFinderClass() != null) { try { final Constructor<? extends Finder> constructor = getFinderClass() .getConstructor(Context.class, Class.class); if (constructor != null) { result = constructor.newInstance(getContext(), targetClass); } } catch (Exception e) { getLogger().log(Level.WARNING, "Exception while instantiating the finder.", e); } } return result; }