svn commit: rev 22710 - avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks

[email protected]
Newsgroups gmane.comp.jakarta.avalon.cvs
Message-ID <[email protected]>
Author: mcconnell
Date: Thu Jul  8 04:42:32 2004
New Revision: 22710

Modified:
   avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/GumpTask.java
Log:
Add nag model.

Modified: avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/GumpTask.java
==============================================================================
--- avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/GumpTask.java	(original)
+++ avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/GumpTask.java	Thu Jul  8 04:42:32 2004
@@ -49,6 +49,42 @@
  */
 public class GumpTask extends SystemTask
 {
+    private static final String MAGIC_INTEGRATION =
+      "Magic Integration &lt;[email protected]&gt;";
+ 
+    public static class Nag
+    {
+        private String m_from;
+        private String m_to;
+
+        public void setFrom( String from )
+        {
+            m_from = from;
+        }
+   
+        public String getFrom()
+        {
+            if( null != m_from )
+            {
+                return m_from;
+            }
+            else
+            {
+                return MAGIC_INTEGRATION;
+            }
+        }
+
+        public void setTo( String to )
+        {
+            m_to = to;
+        }
+   
+        public String getTo()
+        {
+            return m_to;
+        }
+    }
+
     public static class Href
     {
         private String m_href;
@@ -152,6 +188,7 @@
     private License m_license;
     private Template m_template = new Template();
     private boolean m_public = false;
+    private Nag m_nag;
 
     public void setName( String name )
     {
@@ -239,6 +276,19 @@
         }
     }
 
+    public Nag createNag()
+    {
+        if( null == m_nag )
+        {
+            m_nag = new Nag();
+            return m_nag;
+        }
+        else
+        {
+            throw new BuildException( "Multiple nag entries not allowed." );
+        }
+    }
+
     public Template createTemplate()
     {
         return m_template;
@@ -554,9 +604,11 @@
               "\n    <!-- doc output is relative merlin home docs cache -->" );
         }
 
-        writer.write( "\n    <nag to=\"[email protected]\"" ); 
-        writer.write( "\n       from=\"Magic Integration &lt;[email protected]&gt;\"/>" );
-
+        if( null != m_nag )
+        {
+            writer.write( "\n    <nag to=\"" + m_nag.getTo() + "\"" );
+            writer.write( "\n       from=\"" + m_nag.getFrom() + "\"/>" );
+        }
         writer.write( "\n  </project>" );
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.