Update of /cvsroot/xdoclet/xdoclet2/core/src/java/xdoclet/generators
In directory sc8-pr-cvs1:/tmp/cvs-serv7981/core/src/java/xdoclet/generators

Modified Files:
        CastorGenerator.java JAXBGenerator.java VelocityGenerator.java 
        ZeusGenerator.java 
Added Files:
        XMLGenerator.java 
Log Message:
-Made it possible to use custom generation (arbitrary number of files) in addition to 
per class and for all classes.
-Moved some classes to more appropriate packages

--- NEW FILE: XMLGenerator.java ---
package xdoclet.generators;

import xdoclet.Generator;
import xdoclet.FileDestination;
import xdoclet.XDocletException;

import java.util.Collection;

/**
 * Base class for XML generators
 *
 * @author    <a href="mailto:[EMAIL PROTECTED]";>Aslak Helles&oslash;y</a>
 * @version   $Revision: 1.1 $
 */
public abstract class XMLGenerator extends Generator
{
    public XMLGenerator(FileDestination destination, Collection acceptedClasses)
    {
        super(destination, acceptedClasses);
    }

    protected final int getGenerationMode()
    {
        return MODE_FOR_ALL_CLASSES;
    }

    protected abstract Object getContentTree(Collection classes) throws 
XDocletException;
}
Index: CastorGenerator.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet2/core/src/java/xdoclet/generators/CastorGenerator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** CastorGenerator.java        22 Nov 2002 14:22:30 -0000      1.2
--- CastorGenerator.java        22 Nov 2002 18:57:38 -0000      1.3
***************
*** 3,7 ****
  import xdoclet.XDocletException;
  import xdoclet.Destination;
- import xdoclet.XMLGenerator;
  import xdoclet.FileDestination;
  
--- 3,6 ----
***************
*** 15,19 ****
  
  /**
!  * Generator backed by <a href="http://castor.exolab./";>Castor</a>
   *
   * @author <a href="aslak.hellesoy at bekk.no">Aslak Helles&oslash;y</a>
--- 14,18 ----
  
  /**
!  * Generator backed by <a href="http://castor.exolab.org/";>Castor</a>
   *
   * @author <a href="aslak.hellesoy at bekk.no">Aslak Helles&oslash;y</a>
***************
*** 22,26 ****
  {
      /**
!      * Creates a new JAXBGenerator
       *
       * @barter.pre root != null
--- 21,25 ----
  {
      /**
!      * Creates a new CastorGenerator
       *
       * @barter.pre root != null
***************
*** 31,35 ****
      }
  
!     public void generate(Collection classes, Writer out)
              throws XDocletException
      {
--- 30,34 ----
      }
  
!     public void generateForClasses(Collection classes, Writer out)
              throws XDocletException
      {

Index: JAXBGenerator.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet2/core/src/java/xdoclet/generators/JAXBGenerator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** JAXBGenerator.java  8 Nov 2002 02:26:06 -0000       1.1
--- JAXBGenerator.java  22 Nov 2002 18:57:38 -0000      1.2
***************
*** 2,6 ****
  
  import xdoclet.XDocletException;
- import xdoclet.XMLGenerator;
  import xdoclet.FileDestination;
  
--- 2,5 ----
***************
*** 30,34 ****
      }
  
!     public void generate( Collection classes, Writer out )
                  throws XDocletException
      {
--- 29,33 ----
      }
  
!     public void generateForClasses( Collection classes, Writer out )
                  throws XDocletException
      {

Index: VelocityGenerator.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet2/core/src/java/xdoclet/generators/VelocityGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** VelocityGenerator.java      19 Nov 2002 22:08:50 -0000      1.3
--- VelocityGenerator.java      22 Nov 2002 18:57:38 -0000      1.4
***************
*** 41,46 ****
      private final Map _contextObjects = new HashMap();
  
      public static void init( ClasspathManager classpathManager ) {
!         xdoclet.util.VelocityConfigurer velocityConfigurer = new 
xdoclet.util.VelocityConfigurer(_velocityEngine);
          // We're adding FileResourceLoader first, so users can easily override 
templates
          // by putting them earlier on the classpath
--- 41,52 ----
      private final Map _contextObjects = new HashMap();
  
+     /**
+      * Initialises Velocity by registering a FileResourceLoader and a 
+JarResourceLoader that
+      * use the dirsctories and jar files supplied by the classpathManager.
+      *
+      * @param classpathManager the ClasspathManager that knows about directories and 
+jars.
+      */
      public static void init( ClasspathManager classpathManager ) {
!         VelocityConfigurer velocityConfigurer = new 
VelocityConfigurer(_velocityEngine);
          // We're adding FileResourceLoader first, so users can easily override 
templates
          // by putting them earlier on the classpath
***************
*** 55,62 ****
  
      /**
!      * Creates a new VelocityGenerator.
       *
       * @param templateName name of the template to use during generation
-      * @param contextObjects objects to put on Velocity's context
       */
      public VelocityGenerator(Destination destination, Collection acceptedClasses, 
String templateName) {
--- 61,67 ----
  
      /**
!      * {@inheritDoc}
       *
       * @param templateName name of the template to use during generation
       */
      public VelocityGenerator(Destination destination, Collection acceptedClasses, 
String templateName) {
***************
*** 74,87 ****
        }
  
!     protected void generate( Collection classes, Writer writer ) throws 
XDocletException {
                getContectObjects().put("classes", classes);
                generate( writer );
-               System.out.println("generate1");
      }
  
!     protected void generate( XClass clazz, Writer writer ) throws XDocletException {
                getContectObjects().put("class", clazz);
                generate( writer );
-               System.out.println("generate2");
      }
  
--- 79,90 ----
        }
  
!     protected void generateForClasses( Collection classes, Writer writer ) throws 
XDocletException {
                getContectObjects().put("classes", classes);
                generate( writer );
      }
  
!     protected void generateForClass( XClass clazz, Writer writer ) throws 
XDocletException {
                getContectObjects().put("class", clazz);
                generate( writer );
      }
  

Index: ZeusGenerator.java
===================================================================
RCS file: 
/cvsroot/xdoclet/xdoclet2/core/src/java/xdoclet/generators/ZeusGenerator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** ZeusGenerator.java  22 Nov 2002 18:02:59 -0000      1.1
--- ZeusGenerator.java  22 Nov 2002 18:57:38 -0000      1.2
***************
*** 2,6 ****
  
  import xdoclet.XDocletException;
- import xdoclet.XMLGenerator;
  import xdoclet.FileDestination;
  
--- 2,5 ----
***************
*** 24,28 ****
      }
  
!     public void generate( Collection classes, Writer out )
                  throws XDocletException
      {
--- 23,27 ----
      }
  
!     public void generateForClasses( Collection classes, Writer out )
                  throws XDocletException
      {



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to