Author: rdonkin
Date: Thu May 26 13:54:13 2011
New Revision: 1127915

URL: http://svn.apache.org/viewvc?rev=1127915&view=rev
Log:
MAILETDOCS-4 Factored out descriptor processing.

Modified:
    
james/mailet/maven-mailetdocs-plugin/trunk/src/main/java/org/apache/james/mailet/MailetdocsMojo.java

Modified: 
james/mailet/maven-mailetdocs-plugin/trunk/src/main/java/org/apache/james/mailet/MailetdocsMojo.java
URL: 
http://svn.apache.org/viewvc/james/mailet/maven-mailetdocs-plugin/trunk/src/main/java/org/apache/james/mailet/MailetdocsMojo.java?rev=1127915&r1=1127914&r2=1127915&view=diff
==============================================================================
--- 
james/mailet/maven-mailetdocs-plugin/trunk/src/main/java/org/apache/james/mailet/MailetdocsMojo.java
 (original)
+++ 
james/mailet/maven-mailetdocs-plugin/trunk/src/main/java/org/apache/james/mailet/MailetdocsMojo.java
 Thu May 26 13:54:13 2011
@@ -85,8 +85,6 @@ public class MailetdocsMojo extends Abst
 
     protected void executeReport(Locale locale) throws MavenReportException {
         
-        final List<MailetMatcherDescriptor> descriptors = buildDescriptors();
-
         getLog().info("Executing Mailets/Matchers Report");
 
         getSink().head();
@@ -97,6 +95,24 @@ public class MailetdocsMojo extends Abst
 
         getSink().body();
 
+        getSink().section1();
+        getSink().sectionTitle1();
+        getSink().text("Mailets and Matchers Reference");
+        getSink().sectionTitle1_();
+        getSink().section1_();
+        
+        writeDescriptions();
+
+        getSink().body_();
+
+        getSink().flush();
+        getSink().close();
+    }
+
+    private void writeDescriptions() {
+        
+        final List<MailetMatcherDescriptor> descriptors = buildDescriptors();
+        
         @SuppressWarnings("unchecked")
         List<MailetMatcherDescriptor> matchers = 
(List<MailetMatcherDescriptor>) CollectionUtils.select(descriptors,
                 new TypePredicate(MailetMatcherDescriptor.Type.MATCHER));
@@ -104,12 +120,6 @@ public class MailetdocsMojo extends Abst
         List<MailetMatcherDescriptor> mailets = 
(List<MailetMatcherDescriptor>) CollectionUtils.select(descriptors,
                 new TypePredicate(MailetMatcherDescriptor.Type.MAILET));
         
-        getSink().section1();
-        getSink().sectionTitle1();
-        getSink().text("Mailets and Matchers Reference");
-        getSink().sectionTitle1_();
-        getSink().section1_();
-        
         if (matchers.size() > 0 && mailets.size() > 0) {
             getSink().table();
             getSink().tableRow();
@@ -137,11 +147,6 @@ public class MailetdocsMojo extends Abst
         if (mailets.size() > 0) {
             outputDescriptorList(mailets, "Mailets");
         }
-
-        getSink().body_();
-
-        getSink().flush();
-        getSink().close();
     }
 
     private List<MailetMatcherDescriptor> buildDescriptors() {



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to