Author: rdonkin
Date: Tue Aug  9 13:13:18 2005
New Revision: 231099

URL: http://svn.apache.org/viewcvs?rev=231099&view=rev
Log:
Added extra comments to the example. Thanks to Kirill Grouchnikov for pointing 
out ways that the example could be enhanced.

Modified:
    jakarta/commons/proper/betwixt/trunk/xdocs/guide/examples.xml

Modified: jakarta/commons/proper/betwixt/trunk/xdocs/guide/examples.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/betwixt/trunk/xdocs/guide/examples.xml?rev=231099&r1=231098&r2=231099&view=diff
==============================================================================
--- jakarta/commons/proper/betwixt/trunk/xdocs/guide/examples.xml (original)
+++ jakarta/commons/proper/betwixt/trunk/xdocs/guide/examples.xml Tue Aug  9 
13:13:18 2005
@@ -112,14 +112,20 @@
         
beanWriter.getXMLIntrospector().getConfiguration().setAttributesForPrimitives(false);
         beanWriter.getBindingConfiguration().setMapIDs(false);
         beanWriter.enablePrettyPrint();
-        
-        // Write example bean as base element 'person'
+
+        // If the base element is not passed in, Betwixt will guess 
+        // But let's write example bean as base element 'person'
         beanWriter.write("person", new PersonBean("John Smith", 21));
         
         // Write to System.out
         // (We could have used the empty constructor for BeanWriter 
         // but this way is more instructive)
         System.out.println(outputWriter.toString());
+        
+        // Betwixt writes fragments not documents so does not automatically 
close 
+        // writers or streams.
+        // This example will do no more writing so close the writer now.
+        outputWriter.close();
     }
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to