db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1456694 [2/2] - in /db/torque/torque4/trunk/torque-generator/src: main/java/org/apache/torque/generator/configuration/ main/java/org/apache/torque/generator/configuration/controller/ main/java/org/apache/torque/generator/configuration/merg...
Date Thu, 14 Mar 2013 21:54:48 GMT
Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/TypedOutletSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/TypedOutletSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/TypedOutletSaxHandlerFactory.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/TypedOutletSaxHandlerFactory.java
Thu Mar 14 21:54:47 2013
@@ -21,7 +21,7 @@ package org.apache.torque.generator.conf
 
 import org.apache.torque.generator.configuration.ConfigurationHandlers;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.qname.QualifiedName;
 import org.xml.sax.SAXException;
 
@@ -51,7 +51,7 @@ public abstract interface TypedOutletSax
      *        the parsed xml.
      * @param configurationProvider The access object for the configuration
      *        files, not null.
-     * @param projectPaths The paths of the surrounding project, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      * @param configurationHandlers the available configuration handlers,
      *        not null.
      *
@@ -63,7 +63,7 @@ public abstract interface TypedOutletSax
     OutletSaxHandler getOutletSaxHandler(
             QualifiedName outletName,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
         throws SAXException;
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/UntypedOutletSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/UntypedOutletSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/UntypedOutletSaxHandlerFactory.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/UntypedOutletSaxHandlerFactory.java
Thu Mar 14 21:54:47 2013
@@ -21,7 +21,7 @@ package org.apache.torque.generator.conf
 
 import org.apache.torque.generator.configuration.ConfigurationHandlers;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.qname.QualifiedName;
 import org.xml.sax.SAXException;
 
@@ -35,9 +35,12 @@ public abstract interface UntypedOutletS
      * Returns whether the handler can create OutletSaxHandlers for the given
      * type.
      *
+     * @param type the type to check.
+     * @param unitDescriptor The description of the generation unit, not null.
+     *
      * @return true if the type is supported, false if not.
      */
-    boolean canHandle(String type);
+    boolean canHandle(String type, UnitDescriptor unitDescriptor);
 
     /**
      * Returns a OutletSaxHandler for reading in the configuration of
@@ -52,7 +55,7 @@ public abstract interface UntypedOutletS
      *        the parsed XML.
      * @param configurationProvider The access object for the configuration
      *        files, not null.
-     * @param projectPaths The paths of the surrounding project, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      * @param configurationHandlers the available configuration handlers,
      *        not null.
      *
@@ -65,7 +68,7 @@ public abstract interface UntypedOutletS
             String outletType,
             QualifiedName outletName,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
         throws SAXException;
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/VelocityOutletSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/VelocityOutletSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/VelocityOutletSaxHandler.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/VelocityOutletSaxHandler.java
Thu Mar 14 21:54:47 2013
@@ -30,7 +30,7 @@ import org.apache.torque.generator.confi
 import org.apache.torque.generator.configuration.ConfigurationHandlers;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
 import org.apache.torque.generator.configuration.SaxHelper;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.qname.QualifiedName;
 import org.apache.torque.generator.template.velocity.VelocityOutlet;
 import org.xml.sax.Attributes;
@@ -51,7 +51,7 @@ class VelocityOutletSaxHandler extends O
      *        the parsed XML.
      * @param configurationProvider The access object for the configuration
      *        files, not null.
-     * @param projectPaths The paths of the surrounding project, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      * @param configurationHandlers the available configuration handlers,
      *        not null.
      *
@@ -60,13 +60,13 @@ class VelocityOutletSaxHandler extends O
     public VelocityOutletSaxHandler(
             QualifiedName outletName,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
        throws SAXException
     {
         super(outletName,
                configurationProvider,
-               projectPaths,
+               unitDescriptor,
                configurationHandlers);
     }
 

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/VelocityOutletSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/VelocityOutletSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/VelocityOutletSaxHandlerFactory.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/VelocityOutletSaxHandlerFactory.java
Thu Mar 14 21:54:47 2013
@@ -21,7 +21,7 @@ package org.apache.torque.generator.conf
 
 import org.apache.torque.generator.configuration.ConfigurationHandlers;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.qname.QualifiedName;
 import org.xml.sax.SAXException;
 
@@ -59,7 +59,7 @@ public class VelocityOutletSaxHandlerFac
      *        the parsed xml.
      * @param configurationProvider The access object for the configuration
      *        files, not null.
-     * @param projectPaths The paths of the surrounding project, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      * @param configurationHandlers the available configuration handlers,
      *        not null.
      *
@@ -68,14 +68,14 @@ public class VelocityOutletSaxHandlerFac
     public final OutletSaxHandler getOutletSaxHandler(
             QualifiedName outletName,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
          throws SAXException
     {
         return new VelocityOutletSaxHandler(
                 outletName,
                 configurationProvider,
-                projectPaths,
+                unitDescriptor,
                 configurationHandlers);
     }
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/EntityReferenceSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/EntityReferenceSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/EntityReferenceSaxHandler.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/EntityReferenceSaxHandler.java
Thu Mar 14 21:54:47 2013
@@ -29,7 +29,7 @@ import java.io.InputStream;
 import org.apache.commons.io.IOUtils;
 import org.apache.torque.generator.configuration.ConfigurationException;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
@@ -53,21 +53,21 @@ public class EntityReferenceSaxHandler e
      *
      * @param configurationProvider The access object for the configuration
      *        files, not null.
-     * @param projectPaths The paths of the surrounding project, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
      * @throws NullPointerException if an argument is null.
      */
     public EntityReferenceSaxHandler(
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths)
+            UnitDescriptor unitDescriptor)
     {
         if (configurationProvider == null)
         {
             throw new NullPointerException("configurationProvider must not be null");
         }
-        if (projectPaths == null)
+        if (unitDescriptor == null)
         {
-            throw new NullPointerException("projectPaths must not be null");
+            throw new NullPointerException("unitDescriptor must not be null");
         }
         this.configurationProvider = configurationProvider;
     }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/FileSourceSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/FileSourceSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/FileSourceSaxHandler.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/FileSourceSaxHandler.java
Thu Mar 14 21:54:47 2013
@@ -32,7 +32,7 @@ import org.apache.torque.generator.confi
 import org.apache.torque.generator.configuration.ConfigurationHandlers;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
 import org.apache.torque.generator.configuration.SaxHelper;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.file.Fileset;
 import org.apache.torque.generator.source.SourceProvider;
 import org.apache.torque.generator.source.stream.FileSourceProvider;
@@ -79,17 +79,17 @@ public class FileSourceSaxHandler extend
      *
      * @param configurationProvider The access object for the configuration
      *        files, not null.
-     * @param projectPaths The paths of the surrounding project, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      * @param configurationHandlers All known configuration handlers, not null.
      *
      * @throws NullPointerException if an argument is null.
      */
     public FileSourceSaxHandler(
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
     {
-        super(configurationProvider, projectPaths, configurationHandlers);
+        super(configurationProvider, unitDescriptor, configurationHandlers);
     }
 
     /**
@@ -168,7 +168,8 @@ public class FileSourceSaxHandler extend
                     }
                 }
                 Fileset sourceFileset = new Fileset(
-                        getProjectPaths().getDefaultSourcePath(),
+                        getUnitDescriptor().getProjectPaths()
+                            .getDefaultSourcePath(),
                         includes,
                         excludes);
 

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/FileSourceSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/FileSourceSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/FileSourceSaxHandlerFactory.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/FileSourceSaxHandlerFactory.java
Thu Mar 14 21:54:47 2013
@@ -21,7 +21,7 @@ package org.apache.torque.generator.conf
 
 import org.apache.torque.generator.configuration.ConfigurationHandlers;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 
 /**
  * A Factory which creates a SAX handler for file sources.
@@ -52,19 +52,19 @@ public class FileSourceSaxHandlerFactory
      *
      * @param configurationProvider The access object for the configuration
      *        files, not null.
-     * @param projectPaths The paths of the surrounding project, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      * @param configurationHandlers All known configuration handlers, not null.
      *
      * @return a new FileSourcesSaxHandlers.
      */
     public final SourceSaxHandler getSourceSaxHandler(
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
     {
         return new FileSourceSaxHandler(
                 configurationProvider,
-                projectPaths,
+                unitDescriptor,
                 configurationHandlers);
     }
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/JdbcMetadataSourceSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/JdbcMetadataSourceSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/JdbcMetadataSourceSaxHandler.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/JdbcMetadataSourceSaxHandler.java
Thu Mar 14 21:54:47 2013
@@ -29,7 +29,7 @@ import static org.apache.torque.generato
 import org.apache.torque.generator.configuration.ConfigurationException;
 import org.apache.torque.generator.configuration.ConfigurationHandlers;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.source.SourceProvider;
 import org.apache.torque.generator.source.jdbc.JdbcMetadataSourceProvider;
 import org.xml.sax.Attributes;
@@ -51,17 +51,17 @@ public class JdbcMetadataSourceSaxHandle
      *
      * @param configurationProvider The access object for the configuration
      *        files, not null.
-     * @param projectPaths The paths of the surrounding project, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      * @param configurationHandlers All known configuration handlers, not null.
      *
      * @throws NullPointerException if an argument is null.
      */
     public JdbcMetadataSourceSaxHandler(
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
     {
-        super(configurationProvider, projectPaths, configurationHandlers);
+        super(configurationProvider, unitDescriptor, configurationHandlers);
     }
 
     /**

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/JdbcMetadataSourceSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/JdbcMetadataSourceSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/JdbcMetadataSourceSaxHandlerFactory.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/JdbcMetadataSourceSaxHandlerFactory.java
Thu Mar 14 21:54:47 2013
@@ -21,7 +21,7 @@ package org.apache.torque.generator.conf
 
 import org.apache.torque.generator.configuration.ConfigurationHandlers;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 
 /**
  * A Factory which creates a SAX handler for sources from JDBC Metadata.
@@ -52,19 +52,19 @@ public class JdbcMetadataSourceSaxHandle
      *
      * @param configurationProvider The access object for the configuration
      *        files, not null.
-     * @param projectPaths The paths of the surrounding project, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      * @param configurationHandlers All known configuration handlers, not null.
      *
      * @return a new FileSourcesSaxHandlers.
      */
     public final SourceSaxHandler getSourceSaxHandler(
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
     {
         return new JdbcMetadataSourceSaxHandler(
                 configurationProvider,
-                projectPaths,
+                unitDescriptor,
                 configurationHandlers);
     }
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceSaxHandler.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceSaxHandler.java
Thu Mar 14 21:54:47 2013
@@ -30,7 +30,7 @@ import java.util.List;
 import org.apache.torque.generator.configuration.ConfigurationException;
 import org.apache.torque.generator.configuration.ConfigurationHandlers;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.source.SourceProcessConfiguration;
 import org.apache.torque.generator.source.SourceProvider;
 import org.apache.torque.generator.source.SourceTransformerDefinition;
@@ -47,8 +47,8 @@ public abstract class SourceSaxHandler e
     /** The access object for the configuration files, not null. */
     private ConfigurationProvider configurationProvider;
 
-    /** The paths of the surrounding project, not null. */
-    private ProjectPaths projectPaths;
+    /** The description of the generation unit, not null. */
+    private UnitDescriptor unitDescriptor;
 
     /** The known configuration handlers. */
     private ConfigurationHandlers configurationHandlers;
@@ -73,14 +73,14 @@ public abstract class SourceSaxHandler e
      *
      * @param configurationProvider The access object for the configuration
      *        files, not null.
-     * @param projectPaths The paths of the surrounding project, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      * @param configurationHandlers All known configuration handlers, not null.
      *
      * @throws NullPointerException if an argument is null.
      */
     public SourceSaxHandler(
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
     {
         if (configurationProvider == null)
@@ -88,10 +88,10 @@ public abstract class SourceSaxHandler e
             throw new NullPointerException(
                     "configurationProvider must not be null");
         }
-        if (projectPaths == null)
+        if (unitDescriptor == null)
         {
             throw new NullPointerException(
-                    "projectPaths must not be null");
+                    "unitDescriptor must not be null");
         }
         if (configurationHandlers == null)
         {
@@ -99,7 +99,7 @@ public abstract class SourceSaxHandler e
                     "configurationHandlers must not be null");
         }
         this.configurationProvider = configurationProvider;
-        this.projectPaths = projectPaths;
+        this.unitDescriptor = unitDescriptor;
         this.configurationHandlers = configurationHandlers;
     }
 
@@ -120,7 +120,7 @@ public abstract class SourceSaxHandler e
         {
             transformerSaxHandler
                     = new SourceTransformerSaxHandler(
-                            configurationProvider, projectPaths);
+                            configurationProvider, unitDescriptor);
             transformerSaxHandler.startElement(
                     uri, localName, rawName, attributes);
         }
@@ -132,7 +132,8 @@ public abstract class SourceSaxHandler e
             try
             {
                 sourceProcessConfiguration.setSkipDecider(
-                        attributes.getValue(SKIP_DECIDER_ARRTIBUTE));
+                        attributes.getValue(SKIP_DECIDER_ARRTIBUTE),
+                        unitDescriptor);
             }
             catch (ConfigurationException e)
             {
@@ -211,13 +212,13 @@ public abstract class SourceSaxHandler e
     }
 
     /**
-     * Returns the paths of the surrounding project.
+     * Returns the description of the generation unit.
      *
-     * @return the paths of the surrounding project, not null.
+     * @return the description of the generation unit, not null.
      */
-    public ProjectPaths getProjectPaths()
+    public UnitDescriptor getUnitDescriptor()
     {
-        return projectPaths;
+        return unitDescriptor;
     }
 
     /**

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceSaxHandlerFactory.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceSaxHandlerFactory.java
Thu Mar 14 21:54:47 2013
@@ -21,7 +21,7 @@ package org.apache.torque.generator.conf
 
 import org.apache.torque.generator.configuration.ConfigurationHandlers;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.xml.sax.SAXException;
 
 /**
@@ -46,7 +46,7 @@ public abstract interface SourceSaxHandl
      *
      * @param configurationProvider The access object for the configuration
      *        files, not null.
-     * @param projectPaths The paths of the surrounding project, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      * @param configurationHandlers the available configuration handlers,
      *        not null.
      *
@@ -58,7 +58,7 @@ public abstract interface SourceSaxHandl
      */
     SourceSaxHandler getSourceSaxHandler(
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
         throws SAXException;
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceTransformerSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceTransformerSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceTransformerSaxHandler.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceTransformerSaxHandler.java
Thu Mar 14 21:54:47 2013
@@ -33,7 +33,7 @@ import org.apache.commons.lang.StringUti
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.source.transform.SourceTransformer;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
@@ -47,6 +47,9 @@ public class SourceTransformerSaxHandler
     /** The logger for this class. */
     private static Log log = LogFactory.getLog(DefaultHandler.class);
 
+    /** The description of the generation unit, not null. */
+    private UnitDescriptor unitDescriptor;
+
     /** The SourceTransformer which is currently configured. */
     private SourceTransformer sourceTransformer;
 
@@ -89,22 +92,23 @@ public class SourceTransformerSaxHandler
      *
      * @param configurationProvider The access object for the configuration
      *        files, not null.
-     * @param projectPaths The paths of the surrounding project, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
      * @throws NullPointerException if an argument is null.
      */
     public SourceTransformerSaxHandler(
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths)
+            UnitDescriptor unitDescriptor)
     {
         if (configurationProvider == null)
         {
             throw new NullPointerException("configurationProvider must not be null");
         }
-        if (projectPaths == null)
+        if (unitDescriptor == null)
         {
-            throw new NullPointerException("projectPaths must not be null");
+            throw new NullPointerException("unitDescriptor must not be null");
         }
+        this.unitDescriptor = unitDescriptor;
     }
 
     /**
@@ -130,7 +134,8 @@ public class SourceTransformerSaxHandler
                             + TRANSFORMER_TAG);
                 }
                 elements = attributes.getValue(ELEMENTS_ATTRIBUTE);
-                sourceTransformer = createJavaSourceTransformer(className);
+                sourceTransformer = createJavaSourceTransformer(
+                        className, unitDescriptor);
             }
             else
             {
@@ -295,6 +300,7 @@ public class SourceTransformerSaxHandler
      * Creates an instance of a transformer.
      *
      * @param className the name of the transformer to be created.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
      * @return the instance of the transformer, not null.
      *
@@ -305,13 +311,20 @@ public class SourceTransformerSaxHandler
      *         of the class.
      */
     private static SourceTransformer createJavaSourceTransformer(
-            String className)
+            String className,
+            UnitDescriptor unitDescriptor)
         throws SAXException
     {
         Class<?> transformerClass;
         try
         {
-            transformerClass = Class.forName(className);
+            ClassLoader classLoader = unitDescriptor.getClassLoader();
+            if (classLoader == null)
+            {
+                classLoader
+                        = SourceTransformerSaxHandler.class.getClassLoader();
+            }
+            transformerClass = Class.forName(className, true, classLoader);
         }
         catch (ClassNotFoundException e)
         {

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceProcessConfiguration.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceProcessConfiguration.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceProcessConfiguration.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceProcessConfiguration.java
Thu Mar 14 21:54:47 2013
@@ -26,6 +26,7 @@ import java.util.List;
 
 import org.apache.torque.generator.configuration.ClassHelper;
 import org.apache.torque.generator.configuration.ConfigurationException;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.source.skipDecider.SkipDecider;
 
 /**
@@ -65,19 +66,23 @@ public class SourceProcessConfiguration
      * @param skipDecider the fully qualified name of a class
      *        which determines whether a particular source is skipped,
      *        or null if every source should be used.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
      * @throws ConfigurationException if the class cannot be
      *         instantiated or does not implement the
      *         <code>SkipDecider</code> interface.
      */
-    public void setSkipDecider(String skipDecider)
+    public void setSkipDecider(
+                String skipDecider,
+                UnitDescriptor unitDescriptor)
             throws ConfigurationException
     {
         if (skipDecider != null)
         {
             this.skipDecider = (SkipDecider) ClassHelper.getInstance(
                     skipDecider,
-                    SkipDecider.class);
+                    SkipDecider.class,
+                    unitDescriptor);
         }
         else
         {

Modified: db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/ClasspathConfigurationProviderTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/ClasspathConfigurationProviderTest.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/ClasspathConfigurationProviderTest.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/ClasspathConfigurationProviderTest.java
Thu Mar 14 21:54:47 2013
@@ -54,10 +54,13 @@ public class ClasspathConfigurationProvi
                 new File("src"),
                 outputDirMap,
                 new File("work"));
-
-        classpathConfigurationProvider = new ClasspathConfigurationProvider(
+        UnitDescriptor unitDescriptor = new UnitDescriptor(
+                UnitDescriptor.Packaging.CLASSPATH,
                 projectPaths,
                 new DefaultTorqueGeneratorPaths());
+
+        classpathConfigurationProvider = new ClasspathConfigurationProvider(
+                unitDescriptor);
     }
 
     @Test

Modified: db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/ReadConfigurationTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/ReadConfigurationTest.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/ReadConfigurationTest.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/ReadConfigurationTest.java
Thu Mar 14 21:54:47 2013
@@ -316,7 +316,8 @@ public class ReadConfigurationTest exten
                     sourceProcessConfiguration.setSourceTransformerDefinitions(
                             transformerDefinitions);
                     sourceProcessConfiguration.setSkipDecider(
-                            "org.apache.torque.generator.configuration.ConfigurationTestSkipDecider");
+                            "org.apache.torque.generator.configuration.ConfigurationTestSkipDecider",
+                            unitDescriptor);
                     assertSourceProcessConfigurationEquals(
                             sourceProcessConfiguration,
                             output.getSourceProcessConfiguration());
@@ -540,6 +541,7 @@ public class ReadConfigurationTest exten
         UnitConfiguration unitConfiguration;
         ConfigurationHandlers configurationHandlers
                 = new ConfigurationHandlers();
+        UnitDescriptor unitDescriptor;
         {
             CustomProjectPaths parentProjectPaths
                     = new CustomProjectPaths(
@@ -567,7 +569,7 @@ public class ReadConfigurationTest exten
             projectPaths.setOutputDirectory(
                     "modifiable",
                     new File("src/test/configuration/src/main/custom"));
-            UnitDescriptor unitDescriptor = new UnitDescriptor(
+            unitDescriptor = new UnitDescriptor(
                     UnitDescriptor.Packaging.DIRECTORY,
                     projectPaths,
                     new DefaultTorqueGeneratorPaths());
@@ -715,7 +717,8 @@ public class ReadConfigurationTest exten
                     sourceProcessConfiguration.setSourceTransformerDefinitions(
                             transformerDefinitions);
                     sourceProcessConfiguration.setSkipDecider(
-                            "org.apache.torque.generator.configuration.OtherConfigurationTestSkipDecider");
+                            "org.apache.torque.generator.configuration.OtherConfigurationTestSkipDecider",
+                            unitDescriptor);
                     assertSourceProcessConfigurationEquals(
                             sourceProcessConfiguration,
                             output.getSourceProcessConfiguration());
@@ -852,7 +855,8 @@ public class ReadConfigurationTest exten
                     sourceProcessConfiguration.setSourceTransformerDefinitions(
                             transformerDefinitions);
                     sourceProcessConfiguration.setSkipDecider(
-                        "org.apache.torque.generator.configuration.ConfigurationTestSkipDecider");
+                        "org.apache.torque.generator.configuration.ConfigurationTestSkipDecider",
+                        unitDescriptor);
                     assertSourceProcessConfigurationEquals(
                             sourceProcessConfiguration,
                             output.getSourceProcessConfiguration());

Modified: db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/outlet/GroovyOutletSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/outlet/GroovyOutletSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/outlet/GroovyOutletSaxHandler.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/outlet/GroovyOutletSaxHandler.java
Thu Mar 14 21:54:47 2013
@@ -25,7 +25,7 @@ import static org.apache.torque.generato
 import org.apache.torque.generator.configuration.ConfigurationException;
 import org.apache.torque.generator.configuration.ConfigurationHandlers;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.qname.QualifiedName;
 import org.apache.torque.generator.template.groovy.GroovyOutlet;
 import org.xml.sax.Attributes;
@@ -46,7 +46,7 @@ class GroovyOutletSaxHandler extends Out
      *        the parsed XML.
      * @param configurationProvider The access object for the configuration
      *        files, not null.
-     * @param projectPaths The paths of the surrounding project, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      * @param configurationHandlers the available configuration handlers,
      *        not null.
      *
@@ -55,13 +55,13 @@ class GroovyOutletSaxHandler extends Out
     public GroovyOutletSaxHandler(
             QualifiedName outletName,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
        throws SAXException
     {
         super(outletName,
                configurationProvider,
-               projectPaths,
+               unitDescriptor,
                configurationHandlers);
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message