commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r981229 - /commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/package.html
Date Sun, 01 Aug 2010 14:11:16 GMT
Author: simonetripodi
Date: Sun Aug  1 14:11:16 2010
New Revision: 981229

URL: http://svn.apache.org/viewvc?rev=981229&view=rev
Log:
updated documentation according to latest builder modifications

Modified:
    commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/package.html

Modified: commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/package.html
URL: http://svn.apache.org/viewvc/commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/package.html?rev=981229&r1=981228&r2=981229&view=diff
==============================================================================
--- commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/package.html
(original)
+++ commons/sandbox/at-digester/trunk/src/java/org/apache/commons/digester/annotations/package.html
Sun Aug  1 14:11:16 2010
@@ -326,10 +326,11 @@ public @interface ObjectCreate {
 
     <p>The bootstrap sequence has been designed to be as simple as possible,
     all that's needed is creating a new
-    <code>org.apache.commons.digester.annotations.DigesterLoader</code> instance,
-    plugging optionally the desired
+    <code>org.apache.commons.digester.annotations.DigesterLoaderBuilder</code>
+    instance, plugging the desired
     <code>org.apache.commons.digester.annotations.spi.AnnotationRuleProviderFactory</code>
and
-    <code>org.apache.commons.digester.annotations.spi.DigesterLoaderHandlerFactory</code>.</p>
+    <code>org.apache.commons.digester.annotations.spi.DigesterLoaderHandlerFactory</code>.
+    using a chaining builders pattern.</p>
 
     <p>An <code>org.apache.commons.digester.annotations.spi.AnnotationRuleProviderFactory</code>
     implementation performs the creation of
@@ -356,11 +357,16 @@ public @interface ObjectCreate {
     <p>Said that, to obtain a fresh new
     <code>org.apache.commons.digester.annotations.DigesterLoader</code> instance
     with default factories, it is enough invoking the default empty constructor:</p>
-    <pre>DigesterLoader digesterLoader = new DigesterLoader();</pre>
+
+    <pre>DigesterLoader digesterLoader = new DigesterLoaderBuilder()
+                                    .useDefaultAnnotationRuleProviderFactory()
+                                    .useDefaultDigesterLoaderHandlerFactory();</pre>
+
     <p>Otherwise, if users need specify theyr custom factories:</p>
-    <pre>DigesterLoader digesterLoader =
-        new DigesterLoader(new MyAnnotationRuleProviderFactory(),
-            new MyDigesterLoaderHandlerFactory());</pre>
+
+    <pre>DigesterLoader digesterLoader = new DigesterLoaderBuilder()
+                                    .useAnnotationRuleProviderFactory(new MyAnnotationRuleProviderFactory())
+                                    .useDigesterLoaderHandlerFactory(new MyDigesterLoaderHandlerFactory());</pre>
 
     <a name="doc.Example"></a>
     <h3>Example: a simple RSS parser</h3>
@@ -497,7 +503,9 @@ class Item {
 
     <p>It is now possible to create the <code>Digester</code> instance
and parse the XML:</p>
 
-    <pre>DigesterLoader digesterLoader = new DigesterLoader();
+    <pre>DigesterLoader digesterLoader = new DigesterLoaderBuilder()
+                                    .useDefaultAnnotationRuleProviderFactory()
+                                    .useDefaultDigesterLoaderHandlerFactory();
 ...
 Digester digester = digesterLoader.createDigester(Channel.class);
 try {



Mime
View raw message