52
52
this.interceptor = interceptor;
53
53
this.strategy = strategy;
55
public Value getRoot(Type field, NodeMap<InputNode> node, Map map) throws Exception {
56
return getElement(field, node, map);
59
56
* Here we intercept the call to get the element value from the
60
57
* strategy so that we can change the attributes in the XML element
61
58
* to match what was change on writing the element.
62
59
* @param node this is the XML element to be modified
64
public Value getElement(Type field, NodeMap<InputNode> node, Map map) throws Exception {
61
public Value read(Type field, NodeMap<InputNode> node, Map map) throws Exception {
65
62
interceptor.read(field.getType(), node);
66
return strategy.getElement(field, node, map);
68
public boolean setRoot(Type field, Object value, NodeMap<OutputNode> node, Map map) throws Exception {
69
return setElement(field, value, node, map);
63
return strategy.read(field, node, map);
72
66
* Here we change the XML element after it has been annotated by
74
68
* to the resulting XML document.
75
69
* @param node this is the XML element that will be written
77
public boolean setElement(Type field, Object value, NodeMap<OutputNode> node, Map map) throws Exception {
78
boolean result = strategy.setElement(field, value, node, map);
71
public boolean write(Type field, Object value, NodeMap<OutputNode> node, Map map) throws Exception {
72
boolean result = strategy.write(field, value, node, map);
79
73
interceptor.write(field.getType(), node);