@Test public final void testHasTunables() { assertTrue("Should have found tunables!", interceptor.hasTunables(hasAnnotatedField)); assertTrue("Should have found tunables!", interceptor.hasTunables(hasAnnotatedSetterAndGetterMethods)); }
public boolean hasTunables(final Object o) { for (final Field field : o.getClass().getFields()) { if (field.isAnnotationPresent(Tunable.class)) { return true; } else if (field.isAnnotationPresent(ContainsTunables.class)) { try { Object tunableContainer = field.get(o); return hasTunables(tunableContainer); } catch (final Throwable ex) { logger.debug("ContainsTunables field intercept failed for " + field.toString(), ex); return false; } } } for (final Method method : o.getClass().getMethods()) { if (method.isAnnotationPresent(Tunable.class)) return true; } return false; }
AbstractTunableInterceptor { public boolean hasTunables(final Object o) { for (final Field field : o.getClass().getFields()) { if (field.isAnnotationPresent(Tunable.class)) { return true; } else if (field.isAnnotationPresent(ContainsTunables.class)) { try { Object tunableContainer = field.get(o); return hasTunables(tunableContainer); } catch (final Throwable ex) { logger.debug("ContainsTunables field intercept failed for " + field.toString(), ex); return false; } } } for (final Method method : o.getClass().getMethods()) { if (method.isAnnotationPresent(Tunable.class)) return true; } return false; } }
AbstractTunableInterceptor { public boolean hasTunables(final Object o) { for (final Field field : o.getClass().getFields()) { if (field.isAnnotationPresent(Tunable.class)) { return true; } else if (field.isAnnotationPresent(ContainsTunables.class)) { try { Object tunableContainer = field.get(o); return hasTunables(tunableContainer); } catch (final Throwable ex) { logger.debug("ContainsTunables field intercept failed for " + field.toString(), ex); return false; } } } for (final Method method : o.getClass().getMethods()) { if (method.isAnnotationPresent(Tunable.class)) return true; } return false; } AbstractTunableInterceptor(); }
AbstractTunableInterceptor { public boolean hasTunables(final Object o) { for (final Field field : o.getClass().getFields()) { if (field.isAnnotationPresent(Tunable.class)) { return true; } else if (field.isAnnotationPresent(ContainsTunables.class)) { try { Object tunableContainer = field.get(o); return hasTunables(tunableContainer); } catch (final Throwable ex) { logger.debug("ContainsTunables field intercept failed for " + field.toString(), ex); return false; } } } for (final Method method : o.getClass().getMethods()) { if (method.isAnnotationPresent(Tunable.class)) return true; } return false; } AbstractTunableInterceptor(); final List<T> getHandlers(final Object o); boolean hasTunables(final Object o); void addTunableHandlerFactory(TunableHandlerFactory<T> thf, Map properties); void removeTunableHandlerFactory(TunableHandlerFactory<T> thf, Map properties); }
AbstractTunableInterceptor { public boolean hasTunables(final Object o) { for (final Field field : o.getClass().getFields()) { if (field.isAnnotationPresent(Tunable.class)) { return true; } else if (field.isAnnotationPresent(ContainsTunables.class)) { try { Object tunableContainer = field.get(o); return hasTunables(tunableContainer); } catch (final Throwable ex) { logger.debug("ContainsTunables field intercept failed for " + field.toString(), ex); return false; } } } for (final Method method : o.getClass().getMethods()) { if (method.isAnnotationPresent(Tunable.class)) return true; } return false; } AbstractTunableInterceptor(); final List<T> getHandlers(final Object o); boolean hasTunables(final Object o); void addTunableHandlerFactory(TunableHandlerFactory<T> thf, Map properties); void removeTunableHandlerFactory(TunableHandlerFactory<T> thf, Map properties);  }