You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by rd...@apache.org on 2005/08/09 22:13:20 UTC
svn commit: r231099 -
/jakarta/commons/proper/betwixt/trunk/xdocs/guide/examples.xml
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org