~ubuntu-branches/ubuntu/quantal/simple-xml/quantal

« back to all changes in this revision

Viewing changes to test/src/org/simpleframework/xml/core/DecoratorTest.java

  • Committer: Bazaar Package Importer
  • Author(s): Sylvestre Ledru, Fabian Köster
  • Date: 2010-03-05 19:44:34 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100305194434-d9mwhyioc9npo9it
Tags: 2.3.2-1
* Standards-Version updated to version 3.8.4

[ Fabian Köster ]
* New upstream release
* Correct license information in debian/pom.xml
* Exclude generated Javadoc from orig-tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
            this.interceptor = interceptor;
53
53
            this.strategy = strategy;
54
54
        }
55
 
        public Value getRoot(Type field, NodeMap<InputNode> node, Map map) throws Exception {         
56
 
            return getElement(field, node, map);
57
 
        }
58
55
        /**
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
63
60
         */
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);
67
 
        }
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);
70
64
        }
71
65
        /**
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
76
70
         */
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);
80
74
            return result;
81
75
        }