@Test public void testSetValue() { tested.setValue(instance, "someNewValue"); final Object value = tested.getValue(instance); assertEquals("someNewValue", value); }
@Override public void setValue(final T property, final Object value) { if (null != property) { Class<?> c = property.getClass(); boolean done = false; while (!done && !(c.isAssignableFrom(Object.class))) { Field[] fields = c.getDeclaredFields(); for (Field field : fields) { Value annotation = field.getAnnotation(Value.class); if (null != annotation) { try { field.setAccessible(true); field.set(property, value); done = true; break; } catch (Exception e) { LOG.error("Error setting value for Property with id [" + getId(property) + "] " + "and value [" + (value != null ? value.toString() : "null") + "]"); } } } c = c.getSuperclass(); } } }
BackendPropertyAdapter extends AbstractReflectAdapter<T> implements PropertyAdapter<T, Object> { @Override public void setValue(final T property, final Object value) { if (null != property) { Class<?> c = property.getClass(); boolean done = false; while (!done && !(c.isAssignableFrom(Object.class))) { Field[] fields = c.getDeclaredFields(); for (Field field : fields) { Value annotation = field.getAnnotation(Value.class); if (null != annotation) { try { field.setAccessible(true); field.set(property, value); done = true; break; } catch (Exception e) { LOG.error("Error setting value for Property with id [" + getId(property) + "] " + "and value [" + (value != null ? value.toString() : "null") + "]"); } } } c = c.getSuperclass(); } } } }
BackendPropertyAdapter extends AbstractReflectAdapter<T> implements PropertyAdapter<T, Object> { @Override public void setValue(final T property, final Object value) { if (null != property) { Class<?> c = property.getClass(); boolean done = false; while (!done && !(c.isAssignableFrom(Object.class))) { Field[] fields = c.getDeclaredFields(); for (Field field : fields) { Value annotation = field.getAnnotation(Value.class); if (null != annotation) { try { field.setAccessible(true); field.set(property, value); done = true; break; } catch (Exception e) { LOG.error("Error setting value for Property with id [" + getId(property) + "] " + "and value [" + (value != null ? value.toString() : "null") + "]"); } } } c = c.getSuperclass(); } } }  }
BackendPropertyAdapter extends AbstractReflectAdapter<T> implements PropertyAdapter<T, Object> { @Override public void setValue(final T property, final Object value) { if (null != property) { Class<?> c = property.getClass(); boolean done = false; while (!done && !(c.isAssignableFrom(Object.class))) { Field[] fields = c.getDeclaredFields(); for (Field field : fields) { Value annotation = field.getAnnotation(Value.class); if (null != annotation) { try { field.setAccessible(true); field.set(property, value); done = true; break; } catch (Exception e) { LOG.error("Error setting value for Property with id [" + getId(property) + "] " + "and value [" + (value != null ? value.toString() : "null") + "]"); } } } c = c.getSuperclass(); } } }  @Override String getId(final T property); @Override String getCaption(final T property); @Override Object getValue(final T property); @Override void setValue(final T property,
                         final Object value); @Override boolean accepts(final Class<?> pojo); }
BackendPropertyAdapter extends AbstractReflectAdapter<T> implements PropertyAdapter<T, Object> { @Override public void setValue(final T property, final Object value) { if (null != property) { Class<?> c = property.getClass(); boolean done = false; while (!done && !(c.isAssignableFrom(Object.class))) { Field[] fields = c.getDeclaredFields(); for (Field field : fields) { Value annotation = field.getAnnotation(Value.class); if (null != annotation) { try { field.setAccessible(true); field.set(property, value); done = true; break; } catch (Exception e) { LOG.error("Error setting value for Property with id [" + getId(property) + "] " + "and value [" + (value != null ? value.toString() : "null") + "]"); } } } c = c.getSuperclass(); } } }  @Override String getId(final T property); @Override String getCaption(final T property); @Override Object getValue(final T property); @Override void setValue(final T property,
                         final Object value); @Override boolean accepts(final Class<?> pojo);  }