@Test public void testRead() throws AccessException { String key = "someKey"; String value = "someValue"; objWithExt.getExtendedAttributes().put(key, value); TypedValue readValue = accessor.read(evalContext, objWithExt, key); Assert.assertEquals(value, readValue.getValue()); }
@Override public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException { BaseObjectWithExts<?> objWithExt = (BaseObjectWithExts<?>) target; return new TypedValue(objWithExt.getExtendedAttributes().get(name)); }
ExtendedAttributePropertyAccessor implements PropertyAccessor { @Override public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException { BaseObjectWithExts<?> objWithExt = (BaseObjectWithExts<?>) target; return new TypedValue(objWithExt.getExtendedAttributes().get(name)); } }
ExtendedAttributePropertyAccessor implements PropertyAccessor { @Override public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException { BaseObjectWithExts<?> objWithExt = (BaseObjectWithExts<?>) target; return new TypedValue(objWithExt.getExtendedAttributes().get(name)); }  }
ExtendedAttributePropertyAccessor implements PropertyAccessor { @Override public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException { BaseObjectWithExts<?> objWithExt = (BaseObjectWithExts<?>) target; return new TypedValue(objWithExt.getExtendedAttributes().get(name)); }  @Override Class<?>[] getSpecificTargetClasses(); @Override boolean canRead(EvaluationContext context, Object target, String name); @Override TypedValue read(EvaluationContext context, Object target, String name); @Override boolean canWrite(EvaluationContext context, Object target, String name); @Override void write(EvaluationContext context, Object target, String name, Object newValue); }
ExtendedAttributePropertyAccessor implements PropertyAccessor { @Override public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException { BaseObjectWithExts<?> objWithExt = (BaseObjectWithExts<?>) target; return new TypedValue(objWithExt.getExtendedAttributes().get(name)); }  @Override Class<?>[] getSpecificTargetClasses(); @Override boolean canRead(EvaluationContext context, Object target, String name); @Override TypedValue read(EvaluationContext context, Object target, String name); @Override boolean canWrite(EvaluationContext context, Object target, String name); @Override void write(EvaluationContext context, Object target, String name, Object newValue);  }