@Override @Nullable protected FieldPropertyHandler getLocalPropertyHandler(String propertyName) { FieldPropertyHandler propertyHandler = this.fieldMap.get(propertyName); if (propertyHandler == null) { Field field = ReflectionUtils.findField(getWrappedClass(), propertyName); if (field != null) { propertyHandler = new FieldPropertyHandler(field); this.fieldMap.put(propertyName, propertyHandler); } } return propertyHandler; }
@Override public void setValue(@Nullable Object value) throws Exception { try { ReflectionUtils.makeAccessible(this.field); this.field.set(getWrappedInstance(), value); } catch (IllegalAccessException ex) { throw new InvalidPropertyException(getWrappedClass(), this.field.getName(), "Field is not accessible", ex); } } }
@Override @Nullable public Object getValue() throws Exception { try { ReflectionUtils.makeAccessible(this.field); return this.field.get(getWrappedInstance()); } catch (IllegalAccessException ex) { throw new InvalidPropertyException(getWrappedClass(), this.field.getName(), "Field is not accessible", ex); } }
@Override @Nullable protected FieldPropertyHandler getLocalPropertyHandler(String propertyName) { FieldPropertyHandler propertyHandler = this.fieldMap.get(propertyName); if (propertyHandler == null) { Field field = ReflectionUtils.findField(getWrappedClass(), propertyName); if (field != null) { propertyHandler = new FieldPropertyHandler(field); this.fieldMap.put(propertyName, propertyHandler); } } return propertyHandler; }
@Override @Nullable public Object getValue() throws Exception { try { ReflectionUtils.makeAccessible(this.field); return this.field.get(getWrappedInstance()); } catch (IllegalAccessException ex) { throw new InvalidPropertyException(getWrappedClass(), this.field.getName(), "Field is not accessible", ex); } }
@Override public void setValue(@Nullable Object value) throws Exception { try { ReflectionUtils.makeAccessible(this.field); this.field.set(getWrappedInstance(), value); } catch (IllegalAccessException ex) { throw new InvalidPropertyException(getWrappedClass(), this.field.getName(), "Field is not accessible", ex); } } }
@Override protected FieldPropertyHandler getLocalPropertyHandler(String propertyName) { FieldPropertyHandler propertyHandler = this.fieldMap.get(propertyName); if (propertyHandler == null) { Field field = ReflectionUtils.findField(getWrappedClass(), propertyName); if (field != null) { propertyHandler = new FieldPropertyHandler(field); this.fieldMap.put(propertyName, propertyHandler); } } return propertyHandler; }
@Override public void setValue(Object object, Object value) throws Exception { try { ReflectionUtils.makeAccessible(this.field); this.field.set(object, value); } catch (IllegalAccessException ex) { throw new InvalidPropertyException(getWrappedClass(), this.field.getName(), "Field is not accessible", ex); } } }
@Override public Object getValue() throws Exception { try { ReflectionUtils.makeAccessible(this.field); return this.field.get(getWrappedInstance()); } catch (IllegalAccessException ex) { throw new InvalidPropertyException(getWrappedClass(), this.field.getName(), "Field is not accessible", ex); } }