Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
BZ-1004499: fixed read issue on simple type fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
pefernan committed Sep 6, 2013
1 parent b619788 commit c9045b2
Showing 1 changed file with 1 addition and 19 deletions.
Expand Up @@ -108,12 +108,6 @@ public void setBasicFieldType(FieldType basicFieldType) {

@Override
public void writeValue(Object destination, String propName, Object value) throws Exception {
//TODO.. verify this behaviour
if (destination == null) return;
Field field = destination.getClass().getDeclaredField(propName);

Method setterMethod = destination.getClass().getMethod("set" + capitalize(propName), new Class[]{field.getType()});
setterMethod.invoke(destination, new Object[]{value});
}

@Override
Expand All @@ -124,23 +118,11 @@ public Object readFromBindingExperssion(Object source, String bindingExpression)
bindingExpression = bindingExpressionUtil.extractBindingExpression(bindingExpression);

return readValue(source, bindingExpression);
//String[] bindingParts = bindingExpression.split("/");

//if (bindingParts.length == 2) {
// return readValue(source, bindingParts[1]);
//}
//return null;
}

@Override
public Object readValue(Object source, String propName) throws Exception {
//TODO.. verify this behaviour
if (source == null) return null;

Method getter = source.getClass().getMethod("get" + capitalize(propName));
Object value = getter.invoke(source);

return value;
return source;
}

private String capitalize(String string) {
Expand Down

0 comments on commit c9045b2

Please sign in to comment.