- }\r
- \r
- @Override\r
- public void readFrom(Binding srcBinding, Object src, Object dst)\r
- throws BindingException {\r
- try {\r
- VariantBinding sb = (VariantBinding) srcBinding;\r
- Datatype newType = sb.getContentType(src);\r
- Datatype oldType = getContentType(dst);\r
- Binding scb = sb.getContentBinding(src);\r
- Object sc = sb.getContent(src, scb);\r
- if (newType.equals(oldType)) {\r
- Binding dcb = getContentBinding(dst);\r
- if (dcb.isImmutable()) {\r
- Object dc = Bindings.clone(sc, scb, scb);\r
- setContent(dst, scb, dc);\r
- } else {\r
- Object dc = getContent(dst, dcb);\r
- dc = dcb.readFromTry(scb, sc, dc);\r
- setContent(dst, dcb, dc);\r
- }\r
- } else {\r
- Object dc = Bindings.clone(sc, scb, scb);\r
- setContent(dst, scb, dc);\r
- }\r
- } catch (AdaptException e) {\r
- throw new BindingException(e);\r
- } \r
- \r
+ }
+
+ @Override
+ public void readFrom(Binding srcBinding, Object src, Object dst)
+ throws BindingException {
+ try {
+ VariantBinding sb = (VariantBinding) srcBinding;
+ Datatype newType = sb.getContentType(src);
+ Datatype oldType = getContentType(dst);
+ Binding scb = sb.getContentBinding(src);
+ Object sc = sb.getContent(src, scb);
+ if (newType.equals(oldType)) {
+ Binding dcb = getContentBinding(dst);
+ if (dcb.isImmutable()) {
+ Object dc = Bindings.clone(sc, scb, scb);
+ setContent(dst, scb, dc);
+ } else {
+ Object dc = getContent(dst, dcb);
+ dc = dcb.readFromTry(scb, sc, dc);
+ setContent(dst, dcb, dc);
+ }
+ } else {
+ Object dc = Bindings.clone(sc, scb, scb);
+ setContent(dst, scb, dc);
+ }
+ } catch (AdaptException e) {
+ throw new BindingException(e);
+ }
+