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 [1/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
Author: tfischer
Date: Thu Mar 14 21:54:47 2013
New Revision: 1456694

URL: http://svn.apache.org/r1456694
Log:
Add possibility to set the class loader for loading template resources.
This is useful e.g. for running inside eclipse.

To be able to get the class loader to the places it is needed, one has to pass around the unit descriptor instead of the project paths.

Modified:
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/ClassHelper.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/ClasspathConfigurationProvider.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/UnitConfigurationReader.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/UnitDescriptor.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/ControlConfigurationSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/ControlConfigurationXmlParser.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/OutputSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ActionSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ActionSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ApplyActionSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ApplyActionSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/MergepointSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OptionActionSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OptionActionSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OutputActionSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OutputActionSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/SourceElementAttributeActionSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/SourceElementAttributeActionSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/TraverseAllActionSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/TraverseAllActionSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/CopyOutletSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/CopyOutletSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationXmlParser.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/ReflectionOutletSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/TypedOutletSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/UntypedOutletSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/VelocityOutletSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/VelocityOutletSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/EntityReferenceSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/FileSourceSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/FileSourceSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/JdbcMetadataSourceSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/JdbcMetadataSourceSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceSaxHandlerFactory.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceTransformerSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceProcessConfiguration.java
    db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/ClasspathConfigurationProviderTest.java
    db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/ReadConfigurationTest.java
    db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/outlet/GroovyOutletSaxHandler.java

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/ClassHelper.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/ClassHelper.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/ClassHelper.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/ClassHelper.java Thu Mar 14 21:54:47 2013
@@ -40,13 +40,15 @@ public final class ClassHelper
      * @param className the fully qualified name of the class to instantiate.
      * @param isInstanceOf the Interface or class the instance
      *        must be an instance of, or null to disable the check.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
      * @throws ConfigurationException if the class cannot be instantiated
      *         or it is not an instance of <code>isInstanceOf</code>
      */
     public static Object getInstance(
                     String className,
-                    Class<?> isInstanceOf)
+                    Class<?> isInstanceOf,
+                    UnitDescriptor unitDescriptor)
             throws ConfigurationException
     {
         if (className == null)
@@ -56,7 +58,12 @@ public final class ClassHelper
         Object result;
         try
         {
-            Class<?> clazz = Class.forName(className);
+            ClassLoader classLoader = unitDescriptor.getClassLoader();
+            if (classLoader == null)
+            {
+                classLoader = ClassHelper.class.getClassLoader();
+            }
+            Class<?> clazz = Class.forName(className, true, classLoader);
             result = clazz.newInstance();
         }
         catch (ClassNotFoundException e)

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/ClasspathConfigurationProvider.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/ClasspathConfigurationProvider.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/ClasspathConfigurationProvider.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/ClasspathConfigurationProvider.java Thu Mar 14 21:54:47 2013
@@ -32,7 +32,6 @@ import java.util.jar.JarFile;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
 import org.apache.torque.generator.configuration.paths.TorqueGeneratorPaths;
 
 /**
@@ -46,45 +45,28 @@ public class ClasspathConfigurationProvi
     private static Log log
             = LogFactory.getLog(ClasspathConfigurationProvider.class);
 
-    /**
-     * The paths needed to interact with the enclosing project, not null.
-     */
-    private ProjectPaths projectPaths;
-
-    /**
-     * The internal directory structure of the Torque generator
-     * configuration files, not null.
-     */
-    private TorqueGeneratorPaths configurationPaths;
+    /** The description of the generation unit, not null. */
+    private UnitDescriptor unitDescriptor;
 
     /** The prefix if an url points to a file. */
     private static final String FILE_URL_PREFIX = "file:";
 
     /**
      * Constructor.
-     * @param projectPaths the paths needed to interact with the enclosing
-     *        project, not null.
-     * @param configurationPaths The internal directory structure of the
-     *        Torque generator configuration files, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
-     * @throws NullPointerException if projectPaths or configurationPaths
-     *         are null.
+     * @throws NullPointerException if unitDescriptor is null.
      */
-    public ClasspathConfigurationProvider(
-            ProjectPaths projectPaths,
-            TorqueGeneratorPaths configurationPaths)
+    public ClasspathConfigurationProvider(UnitDescriptor unitDescriptor)
     {
-        super(configurationPaths);
-        if (projectPaths == null)
-        {
-            throw new NullPointerException("projectPaths is null");
-        }
-        this.projectPaths = projectPaths;
-        this.configurationPaths = configurationPaths;
+        super(unitDescriptor.getConfigurationPaths());
+        this.unitDescriptor = unitDescriptor;
     }
 
     public String getControlConfigurationLocation()
     {
+        TorqueGeneratorPaths configurationPaths
+                = unitDescriptor.getConfigurationPaths();
         return getFileName(
                 configurationPaths.getControlConfigurationFile(),
                 configurationPaths.getConfigurationDirectory());
@@ -114,9 +96,12 @@ public class ClasspathConfigurationProvi
     {
         String fileName = getFileName(name, directory);
 
-        InputStream inputStream
-                = getClass().getClassLoader().getResourceAsStream(
-                        fileName);
+        ClassLoader classLoader = unitDescriptor.getClassLoader();
+        if (classLoader == null)
+        {
+            classLoader = getClass().getClassLoader();
+        }
+        InputStream inputStream = classLoader.getResourceAsStream(fileName);
 
         if (inputStream == null)
         {
@@ -138,16 +123,19 @@ public class ClasspathConfigurationProvi
     public Collection<String> getOutletConfigurationNames()
         throws ConfigurationException
     {
-        String outletConfigurationSubdir
-                = getConfigResourceBase()
-                    + "/"
-                    + configurationPaths.getOutletDirectory();
+        String outletConfigurationSubdir = getConfigResourceBase()
+                + "/"
+                + unitDescriptor.getConfigurationPaths().getOutletDirectory();
         outletConfigurationSubdir
                 = outletConfigurationSubdir.replace('\\', '/');
 
+        ClassLoader classLoader = unitDescriptor.getClassLoader();
+        if (classLoader == null)
+        {
+            classLoader = getClass().getClassLoader();
+        }
 
-        URL dirUrl = getClass().getClassLoader().getResource(
-                    outletConfigurationSubdir);
+        URL dirUrl = classLoader.getResource(outletConfigurationSubdir);
         if (dirUrl == null)
         {
             log.error("Could not open Directory "
@@ -234,7 +222,8 @@ public class ClasspathConfigurationProvi
     private String getConfigResourceBase()
     {
         String configResourceBase
-            = projectPaths.getConfigurationPackage().replace('.', '/');
+            = unitDescriptor.getProjectPaths().getConfigurationPackage()
+                .replace('.', '/');
         return configResourceBase;
     }
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/UnitConfigurationReader.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/UnitConfigurationReader.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/UnitConfigurationReader.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/UnitConfigurationReader.java Thu Mar 14 21:54:47 2013
@@ -327,7 +327,7 @@ class UnitConfigurationReader
                 = new ControlConfigurationXmlParser()
                         .readControllerConfiguration(
                                 configurationProvider,
-                                unitDescriptor.getProjectPaths(),
+                                unitDescriptor,
                                 configurationHandlers);
         if (unitDescriptor.getLoglevel() == null)
         {
@@ -407,8 +407,7 @@ class UnitConfigurationReader
                 == unitDescriptor.getPackaging())
         {
             configurationProvider = new ClasspathConfigurationProvider(
-                    unitDescriptor.getProjectPaths(),
-                    unitDescriptor.getConfigurationPaths());
+                    unitDescriptor);
         }
         else
         {

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/UnitDescriptor.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/UnitDescriptor.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/UnitDescriptor.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/UnitDescriptor.java Thu Mar 14 21:54:47 2013
@@ -85,6 +85,13 @@ public class UnitDescriptor
     private String defaultOutputEncoding = null;
 
     /**
+     * The class loader to use by the generator when accessing the templates
+     * or classes defined within the templates.
+     * If null, the class loader of the torque generator classes is used.
+     */
+    private ClassLoader classLoader;
+
+    /**
      * Constructor without inheritance, override options, overrideSourceFileset,
      * loglevel and addDebuggingInfoToOutput.
      *
@@ -286,4 +293,31 @@ public class UnitDescriptor
     {
         this.defaultOutputEncoding = defaultOutputEncoding;
     }
+
+    /**
+     * Returns the class loader to use by the generator when accessing
+     * the templates or classes defined within the templates.
+     *
+     * @return the class loader for the templates, or null if the standard
+     *         class loader of the torque generator classes is used.
+     */
+    public ClassLoader getClassLoader()
+    {
+        return classLoader;
+    }
+
+    /**
+     * Sets the class loader to use by the generator when accessing
+     * the templates or classes defined within the templates.
+     *
+     * @param classLoader the class loader for the templates,
+     *        or null if the standard class loader
+     *        of the torque generator classes should be used.
+     */
+    public void setClassLoader(ClassLoader classLoader)
+    {
+        this.classLoader = classLoader;
+    }
+
+
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/ControlConfigurationSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/ControlConfigurationSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/ControlConfigurationSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/ControlConfigurationSaxHandler.java Thu Mar 14 21:54:47 2013
@@ -32,12 +32,12 @@ 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.UnitDescriptor;
 import org.apache.torque.generator.configuration.XMLConstants;
 import org.apache.torque.generator.configuration.mergepoint.OptionsSaxHandlerFactories;
 import org.apache.torque.generator.configuration.option.OptionsConfiguration;
 import org.apache.torque.generator.configuration.option.OptionsSaxHandler;
 import org.apache.torque.generator.configuration.option.OptionsSaxHandlerFactory;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
 import org.apache.torque.generator.configuration.source.EntityReferenceSaxHandler;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
@@ -80,9 +80,9 @@ public class ControlConfigurationSaxHand
     private ConfigurationProvider configurationProvider;
 
     /**
-     * The paths in the configuration.
+     * The description of the generation unit, not null.
      */
-    private ProjectPaths projectPaths;
+    private UnitDescriptor unitDescriptor;
 
     /**
      * Constructor.
@@ -90,7 +90,7 @@ public class ControlConfigurationSaxHand
      * @param controllerConfiguration the configuration object to fill, no null.
      * @param configurationProvider the Object for accessing the configuration,
      *        not null.
-     * @param projectPaths the paths in the configuration, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      * @param configurationHandlers the available configuration handlers,
      *        not null.
      *
@@ -99,7 +99,7 @@ public class ControlConfigurationSaxHand
     public ControlConfigurationSaxHandler(
             ControlConfiguration controllerConfiguration,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
     {
         if (controllerConfiguration == null)
@@ -112,10 +112,10 @@ public class ControlConfigurationSaxHand
             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)
         {
@@ -125,7 +125,7 @@ public class ControlConfigurationSaxHand
         this.configurationProvider = configurationProvider;
         this.controllerConfiguration = controllerConfiguration;
         this.configurationHandlers = configurationHandlers;
-        this.projectPaths = projectPaths;
+        this.unitDescriptor = unitDescriptor;
    }
 
     /**
@@ -202,7 +202,7 @@ public class ControlConfigurationSaxHand
         {
             outputSaxHandler = new OutputSaxHandler(
                     configurationProvider,
-                    projectPaths,
+                    unitDescriptor,
                     configurationHandlers);
             outputSaxHandler.startElement(
                     uri,
@@ -214,7 +214,7 @@ public class ControlConfigurationSaxHand
         {
             entityReferenceSaxHandler = new EntityReferenceSaxHandler(
                     configurationProvider,
-                    projectPaths);
+                    unitDescriptor);
             entityReferenceSaxHandler.startElement(
                     uri,
                     localName,

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/ControlConfigurationXmlParser.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/ControlConfigurationXmlParser.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/ControlConfigurationXmlParser.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/ControlConfigurationXmlParser.java Thu Mar 14 21:54:47 2013
@@ -31,7 +31,7 @@ import org.apache.commons.logging.LogFac
 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.xml.sax.InputSource;
 import org.xml.sax.SAXNotRecognizedException;
 import org.xml.sax.SAXNotSupportedException;
@@ -83,7 +83,7 @@ public class ControlConfigurationXmlPars
      *
      * @param configurationProvider the object for accessing the configuration,
      *        not null.
-     * @param projectPaths the paths inside the configuration, not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      * @param configurationHandlers the available configuration handlers,
      *        not null.
      *
@@ -95,7 +95,7 @@ public class ControlConfigurationXmlPars
      */
     public ControlConfiguration readControllerConfiguration(
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
         throws ConfigurationException
     {
@@ -114,7 +114,7 @@ public class ControlConfigurationXmlPars
                         new ControlConfigurationSaxHandler(
                                 result,
                                 configurationProvider,
-                                projectPaths,
+                                unitDescriptor,
                                 configurationHandlers));
             }
             catch (SAXParseException e)

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/OutputSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/OutputSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/OutputSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/OutputSaxHandler.java Thu Mar 14 21:54:47 2013
@@ -33,10 +33,10 @@ import static org.apache.torque.generato
 
 import org.apache.torque.generator.configuration.ConfigurationHandlers;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.configuration.XMLConstants;
 import org.apache.torque.generator.configuration.outlet.OutletConfigurationSaxHandler;
 import org.apache.torque.generator.configuration.outlet.OutletSaxHandler;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
 import org.apache.torque.generator.configuration.source.SourceSaxHandler;
 import org.apache.torque.generator.configuration.source.SourceSaxHandlerFactories;
 import org.apache.torque.generator.configuration.source.SourceSaxHandlerFactory;
@@ -59,8 +59,8 @@ public class OutputSaxHandler extends De
     /** 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;
 
     /** All known configuration handlers. */
     private ConfigurationHandlers configurationHandlers;
@@ -92,14 +92,14 @@ public class OutputSaxHandler extends De
      *
      * @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 handlers for reading the configuration.
      *
      * @throws NullPointerException if an argument is null.
      */
     public OutputSaxHandler(
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
     {
         if (configurationProvider == null)
@@ -107,10 +107,10 @@ public class OutputSaxHandler extends De
             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)
         {
@@ -119,7 +119,7 @@ public class OutputSaxHandler extends De
         }
         this.configurationProvider = configurationProvider;
         this.configurationHandlers = configurationHandlers;
-        this.projectPaths = projectPaths;
+        this.unitDescriptor = unitDescriptor;
     }
 
     /**
@@ -225,7 +225,7 @@ public class OutputSaxHandler extends De
             }
             sourceSaxHandler = sourceSaxHandlerFactory.getSourceSaxHandler(
                     configurationProvider,
-                    projectPaths,
+                    unitDescriptor,
                     configurationHandlers);
             sourceSaxHandler.startElement(uri, localName, rawName, attributes);
         }
@@ -244,7 +244,7 @@ public class OutputSaxHandler extends De
             OutletConfigurationSaxHandler outletConfigurationSaxHandler
                     = new OutletConfigurationSaxHandler(
                             configurationProvider,
-                            projectPaths,
+                            unitDescriptor,
                             configurationHandlers);
             String outletType
                     = OutletConfigurationSaxHandler.getOutletType(

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ActionSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ActionSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ActionSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ActionSaxHandler.java Thu Mar 14 21:54:47 2013
@@ -22,7 +22,7 @@ package org.apache.torque.generator.conf
 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.control.action.MergepointAction;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
@@ -40,8 +40,8 @@ public abstract class ActionSaxHandler e
     /** The action which configured by this handler, not null. */
     private MergepointAction action;
 
-    /** The paths of the underlying project, not null. */
-    private ProjectPaths projectPaths;
+    /** The description of the generation unit, not null. */
+    private UnitDescriptor unitDescriptor;
 
     /** The configuration provider for accessing the configuration, not null. */
     private ConfigurationProvider configurationProvider;
@@ -52,14 +52,14 @@ public abstract class ActionSaxHandler e
      * @param action paths of the underlying project, not null.
      * @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 ActionSaxHandler(
             MergepointAction action,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths)
+            UnitDescriptor unitDescriptor)
     {
         if (action == null)
         {
@@ -73,15 +73,15 @@ public abstract class ActionSaxHandler e
                     + " configurationProvider is null");
             throw new NullPointerException("configurationProvider is null");
         }
-        if (projectPaths == null)
+        if (unitDescriptor == null)
         {
             log.error("ActionSaxHandler: "
-                    + " projectPaths is null");
-            throw new NullPointerException("projectPaths is null");
+                    + " unitDescriptor is null");
+            throw new NullPointerException("unitDescriptor is null");
         }
         this.action = action;
         this.configurationProvider = configurationProvider;
-        this.projectPaths = projectPaths;
+        this.unitDescriptor = unitDescriptor;
     }
 
     /**
@@ -119,12 +119,12 @@ public abstract class ActionSaxHandler e
     }
 
     /**
-     * Returns the project paths used by this handler.
+     * Returns the description of the generation unit.
      *
-     * @return the project paths, not null.
+     * @return the description of the generation unit, not null.
      */
-    protected ProjectPaths getProjectPaths()
+    protected UnitDescriptor getUnitDescriptor()
     {
-        return projectPaths;
+        return unitDescriptor;
     }
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ActionSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ActionSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ActionSaxHandlerFactory.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ActionSaxHandlerFactory.java Thu Mar 14 21:54:47 2013
@@ -20,7 +20,7 @@ package org.apache.torque.generator.conf
  */
 
 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;
 
@@ -59,8 +59,7 @@ public abstract interface ActionSaxHandl
      * @param attributes The attributes attached to the element.
      * @param configurationProvider for accessing the configuration files,
      *        not null.
-     * @param projectPaths The organization of the surrounding project,
-     *        not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
      * @return a SAX delegate handler for parsing the configuration with the
      *           given type.
@@ -73,6 +72,6 @@ public abstract interface ActionSaxHandl
             String qName,
             Attributes attributes,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths)
+            UnitDescriptor unitDescriptor)
         throws SAXException;
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ApplyActionSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ApplyActionSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ApplyActionSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ApplyActionSaxHandler.java Thu Mar 14 21:54:47 2013
@@ -25,7 +25,7 @@ import static org.apache.torque.generato
 
 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.control.action.ApplyAction;
 import org.apache.torque.generator.control.action.MergepointAction;
 import org.xml.sax.Attributes;
@@ -52,8 +52,7 @@ public class ApplyActionSaxHandler exten
      * @param attributes The attributes attached to the element.
      * @param configurationProvider for accessing the configuratiopn files,
      *        not null.
-     * @param projectPaths The organization of the surrounding project,
-     *        not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
      * @throws NullPointerException if an argument is null.
      * @throws SAXException if the element cannot be processed correctly.
@@ -64,10 +63,10 @@ public class ApplyActionSaxHandler exten
             String qName,
             Attributes attributes,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths)
+            UnitDescriptor unitDescriptor)
         throws SAXException
     {
-        super(createAction(attributes), configurationProvider, projectPaths);
+        super(createAction(attributes), configurationProvider, unitDescriptor);
     }
 
     /**

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ApplyActionSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ApplyActionSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ApplyActionSaxHandlerFactory.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/ApplyActionSaxHandlerFactory.java Thu Mar 14 21:54:47 2013
@@ -20,7 +20,7 @@ package org.apache.torque.generator.conf
  */
 
 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;
 
@@ -60,8 +60,7 @@ public class ApplyActionSaxHandlerFactor
      * @param attributes The attributes attached to the element.
      * @param configurationProvider for accessing the configuration files,
      *        not null.
-     * @param projectPaths The organization of the surrounding project,
-     *        not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
      * @return a new ApplyActionSaxHandler.
      */
@@ -71,7 +70,7 @@ public class ApplyActionSaxHandlerFactor
             String qName,
             Attributes attributes,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths)
+            UnitDescriptor unitDescriptor)
          throws SAXException
     {
         return new ApplyActionSaxHandler(
@@ -80,6 +79,6 @@ public class ApplyActionSaxHandlerFactor
                 qName,
                 attributes,
                 configurationProvider,
-                projectPaths);
+                unitDescriptor);
     }
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/MergepointSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/MergepointSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/MergepointSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/MergepointSaxHandler.java Thu Mar 14 21:54:47 2013
@@ -25,8 +25,8 @@ import static org.apache.torque.generato
 
 import org.apache.torque.generator.configuration.ConfigurationHandlers;
 import org.apache.torque.generator.configuration.ConfigurationProvider;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.configuration.XMLConstants;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
@@ -47,9 +47,9 @@ public class MergepointSaxHandler
     private ConfigurationProvider configurationProvider;
 
     /**
-     * The paths of the surrounding project, not null.
+     * The description of the generation unit, not null.
      */
-    private ProjectPaths projectPaths;
+    private UnitDescriptor unitDescriptor;
 
     /**
      * The available configuration handlers.
@@ -72,7 +72,7 @@ public class MergepointSaxHandler
      *
      * @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.
      *
@@ -80,7 +80,7 @@ public class MergepointSaxHandler
      */
     public MergepointSaxHandler(
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
     {
         if (configurationProvider == null)
@@ -88,9 +88,9 @@ public class MergepointSaxHandler
             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");
         }
         if (configurationHandlers == null)
         {
@@ -98,7 +98,7 @@ public class MergepointSaxHandler
                     "configurationHandlers must not be null");
         }
         this.configurationProvider = configurationProvider;
-        this.projectPaths = projectPaths;
+        this.unitDescriptor = unitDescriptor;
         this.configurationHandlers = configurationHandlers;
     }
 
@@ -195,7 +195,7 @@ public class MergepointSaxHandler
                     qName,
                     attributes,
                     configurationProvider,
-                    projectPaths);
+                    unitDescriptor);
         }
         else
         {

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OptionActionSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OptionActionSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OptionActionSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OptionActionSaxHandler.java Thu Mar 14 21:54:47 2013
@@ -24,7 +24,7 @@ import static org.apache.torque.generato
 
 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.control.action.OptionAction;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
@@ -51,7 +51,7 @@ public class OptionActionSaxHandler exte
      *          object.
      * @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.
      * @throws SAXException if the element cannot be processed correctly.
@@ -62,10 +62,10 @@ public class OptionActionSaxHandler exte
             String qName,
             Attributes attributes,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths)
+            UnitDescriptor unitDescriptor)
          throws SAXException
      {
-        super(createAction(attributes), configurationProvider, projectPaths);
+        super(createAction(attributes), configurationProvider, unitDescriptor);
      }
 
     /**

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OptionActionSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OptionActionSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OptionActionSaxHandlerFactory.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OptionActionSaxHandlerFactory.java Thu Mar 14 21:54:47 2013
@@ -20,7 +20,7 @@ package org.apache.torque.generator.conf
  */
 
 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;
 
@@ -60,8 +60,7 @@ public class OptionActionSaxHandlerFacto
      * @param attributes The attributes attached to the element.
      * @param configurationProvider for accessing the configuration files,
      *        not null.
-     * @param projectPaths The organization of the surrounding project,
-     *        not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
      * @return a new OptionActionSaxHandler.
      */
@@ -71,7 +70,7 @@ public class OptionActionSaxHandlerFacto
             String qName,
             Attributes attributes,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths)
+            UnitDescriptor unitDescriptor)
          throws SAXException
     {
         return new OptionActionSaxHandler(
@@ -80,7 +79,7 @@ public class OptionActionSaxHandlerFacto
                 qName,
                 attributes,
                 configurationProvider,
-                projectPaths);
+                unitDescriptor);
     }
 
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OutputActionSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OutputActionSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OutputActionSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OutputActionSaxHandler.java Thu Mar 14 21:54:47 2013
@@ -22,7 +22,7 @@ package org.apache.torque.generator.conf
 import static org.apache.torque.generator.configuration.mergepoint.MergepointConfigurationTags.ACTION_VALUE_ATTRIBUTE;
 
 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.control.action.OutputAction;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
@@ -49,7 +49,7 @@ public class OutputActionSaxHandler exte
      *          object.
      * @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.
      * @throws SAXException if the element cannot be processed correctly.
@@ -60,10 +60,10 @@ public class OutputActionSaxHandler exte
             String qName,
             Attributes attributes,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths)
+            UnitDescriptor unitDescriptor)
          throws SAXException
      {
-        super(createAction(attributes), configurationProvider, projectPaths);
+        super(createAction(attributes), configurationProvider, unitDescriptor);
      }
 
     /**

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OutputActionSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OutputActionSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OutputActionSaxHandlerFactory.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/OutputActionSaxHandlerFactory.java Thu Mar 14 21:54:47 2013
@@ -20,7 +20,7 @@ package org.apache.torque.generator.conf
  */
 
 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;
 
@@ -61,8 +61,7 @@ public class OutputActionSaxHandlerFacto
      * @param attributes The attributes attached to the element.
      * @param configurationProvider for accessing the configuration files,
      *        not null.
-     * @param projectPaths The organization of the surrounding project,
-     *        not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
      * @return a new OptionActionSaxHandler.
      */
@@ -72,7 +71,7 @@ public class OutputActionSaxHandlerFacto
             String qName,
             Attributes attributes,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths)
+            UnitDescriptor unitDescriptor)
          throws SAXException
     {
         return new OutputActionSaxHandler(
@@ -81,7 +80,7 @@ public class OutputActionSaxHandlerFacto
                 qName,
                 attributes,
                 configurationProvider,
-                projectPaths);
+                unitDescriptor);
     }
 
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/SourceElementAttributeActionSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/SourceElementAttributeActionSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/SourceElementAttributeActionSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/SourceElementAttributeActionSaxHandler.java Thu Mar 14 21:54:47 2013
@@ -25,7 +25,7 @@ import static org.apache.torque.generato
 
 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.control.action.SourceElementAttributeAction;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
@@ -50,8 +50,7 @@ public class SourceElementAttributeActio
      * @param attributes The attributes attached to the element.
      * @param configurationProvider for accessing the configuratiopn files,
      *        not null.
-     * @param projectPaths The organization of the surrounding project,
-     *        not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
      * @throws NullPointerException if an argument is null.
      * @throws SAXException if the element cannot be processed correctly.
@@ -62,10 +61,10 @@ public class SourceElementAttributeActio
             String qName,
             Attributes attributes,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths)
+            UnitDescriptor unitDescriptor)
          throws SAXException
      {
-        super(createAction(attributes), configurationProvider, projectPaths);
+        super(createAction(attributes), configurationProvider, unitDescriptor);
      }
 
     /**

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/SourceElementAttributeActionSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/SourceElementAttributeActionSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/SourceElementAttributeActionSaxHandlerFactory.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/SourceElementAttributeActionSaxHandlerFactory.java Thu Mar 14 21:54:47 2013
@@ -20,7 +20,7 @@ package org.apache.torque.generator.conf
  */
 
 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;
 
@@ -60,8 +60,7 @@ public class SourceElementAttributeActio
      * @param attributes The attributes attached to the element.
      * @param configurationProvider for accessing the configuration files,
      *        not null.
-     * @param projectPaths The organization of the surrounding project,
-     *        not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
      * @return a new SourceElementAttributeActionSaxHandler.
      */
@@ -71,7 +70,7 @@ public class SourceElementAttributeActio
             String qName,
             Attributes attributes,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths)
+            UnitDescriptor unitDescriptor)
          throws SAXException
     {
         return new SourceElementAttributeActionSaxHandler(
@@ -80,7 +79,7 @@ public class SourceElementAttributeActio
                 qName,
                 attributes,
                 configurationProvider,
-                projectPaths);
+                unitDescriptor);
     }
 
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/TraverseAllActionSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/TraverseAllActionSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/TraverseAllActionSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/TraverseAllActionSaxHandler.java Thu Mar 14 21:54:47 2013
@@ -25,7 +25,7 @@ import static org.apache.torque.generato
 
 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.control.action.MergepointAction;
 import org.apache.torque.generator.control.action.TraverseAllAction;
 import org.xml.sax.Attributes;
@@ -51,8 +51,7 @@ public class TraverseAllActionSaxHandler
      * @param attributes The attributes attached to the element.
      * @param configurationProvider for accessing the configuratiopn files,
      *        not null.
-     * @param projectPaths The organization of the surrounding project,
-     *        not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
      * @throws NullPointerException if an argument is null.
      * @throws SAXException if the element cannot be processed correctly.
@@ -63,10 +62,10 @@ public class TraverseAllActionSaxHandler
             String qName,
             Attributes attributes,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths)
+            UnitDescriptor unitDescriptor)
          throws SAXException
      {
-        super(createAction(attributes), configurationProvider, projectPaths);
+        super(createAction(attributes), configurationProvider, unitDescriptor);
      }
 
     /**

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/TraverseAllActionSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/TraverseAllActionSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/TraverseAllActionSaxHandlerFactory.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/mergepoint/TraverseAllActionSaxHandlerFactory.java Thu Mar 14 21:54:47 2013
@@ -20,7 +20,7 @@ package org.apache.torque.generator.conf
  */
 
 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;
 
@@ -61,8 +61,7 @@ public class TraverseAllActionSaxHandler
      * @param attributes The attributes attached to the element.
      * @param configurationProvider for accessing the configuration files,
      *        not null.
-     * @param projectPaths The organization of the surrounding project,
-     *        not null.
+     * @param unitDescriptor The description of the generation unit, not null.
      *
      * @return a new TraverseAllActionSaxHandler.
      */
@@ -72,7 +71,7 @@ public class TraverseAllActionSaxHandler
             String qName,
             Attributes attributes,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths)
+            UnitDescriptor unitDescriptor)
          throws SAXException
     {
         return new TraverseAllActionSaxHandler(
@@ -81,7 +80,7 @@ public class TraverseAllActionSaxHandler
                 qName,
                 attributes,
                 configurationProvider,
-                projectPaths);
+                unitDescriptor);
     }
 
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/CopyOutletSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/CopyOutletSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/CopyOutletSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/CopyOutletSaxHandler.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.outlet.copy.CopyOutlet;
 import org.apache.torque.generator.qname.QualifiedName;
 import org.xml.sax.Attributes;
@@ -46,7 +46,7 @@ class CopyOutletSaxHandler extends Outle
      *        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 CopyOutletSaxHandler extends Outle
     public CopyOutletSaxHandler(
             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/CopyOutletSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/CopyOutletSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/CopyOutletSaxHandlerFactory.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/CopyOutletSaxHandlerFactory.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;
 
@@ -58,7 +58,7 @@ public class CopyOutletSaxHandlerFactory
      *        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.
      *
@@ -67,14 +67,14 @@ public class CopyOutletSaxHandlerFactory
     public final OutletSaxHandler getOutletSaxHandler(
             QualifiedName outletName,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
          throws SAXException
     {
         return new CopyOutletSaxHandler(
                 outletName,
                 configurationProvider,
-                projectPaths,
+                unitDescriptor,
                 configurationHandlers);
     }
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandler.java Thu Mar 14 21:54:47 2013
@@ -33,7 +33,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 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.outlet.Outlet;
 import org.apache.torque.generator.qname.QualifiedName;
 import org.xml.sax.Attributes;
@@ -66,7 +66,7 @@ class JavaOutletSaxHandler extends Outle
      *        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.
      *
@@ -75,13 +75,13 @@ class JavaOutletSaxHandler extends Outle
     public JavaOutletSaxHandler(
             QualifiedName outletName,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
         throws SAXException
     {
         super(outletName,
                 configurationProvider,
-                projectPaths,
+                unitDescriptor,
                 configurationHandlers);
     }
 
@@ -147,7 +147,12 @@ class JavaOutletSaxHandler extends Outle
         Class<?> outletClass;
         try
         {
-            outletClass = Class.forName(className);
+            ClassLoader classLoader = getUnitDescriptor().getClassLoader();
+            if (classLoader == null)
+            {
+                classLoader = getClass().getClassLoader();
+            }
+            outletClass = Class.forName(className, true, classLoader);
         }
         catch (ClassNotFoundException e)
         {

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandlerFactory.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandlerFactory.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;
 
@@ -58,7 +58,7 @@ public class JavaOutletSaxHandlerFactory
      *        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.
      *
@@ -67,14 +67,14 @@ public class JavaOutletSaxHandlerFactory
     public final OutletSaxHandler getOutletSaxHandler(
             QualifiedName outletName,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
          throws SAXException
     {
         return new JavaOutletSaxHandler(
                 outletName,
                 configurationProvider,
-                projectPaths,
+                unitDescriptor,
                 configurationHandlers);
     }
 }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationSaxHandler.java Thu Mar 14 21:54:47 2013
@@ -34,10 +34,10 @@ import org.apache.torque.generator.confi
 import org.apache.torque.generator.configuration.ConfigurationProvider;
 import org.apache.torque.generator.configuration.OutletTypes;
 import org.apache.torque.generator.configuration.SaxHelper;
+import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.configuration.XMLConstants;
 import org.apache.torque.generator.configuration.mergepoint.MergepointMapping;
 import org.apache.torque.generator.configuration.mergepoint.MergepointSaxHandler;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
 import org.apache.torque.generator.outlet.Outlet;
 import org.apache.torque.generator.qname.QualifiedName;
 import org.xml.sax.Attributes;
@@ -56,8 +56,8 @@ public class OutletConfigurationSaxHandl
     /** 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 list of outlets which configuration was already parsed. */
     private List<Outlet> outlets = new ArrayList<Outlet>();
@@ -92,7 +92,7 @@ public class OutletConfigurationSaxHandl
      *
      * @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.
      *
@@ -100,7 +100,7 @@ public class OutletConfigurationSaxHandl
      */
     public OutletConfigurationSaxHandler(
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
     {
         if (configurationProvider == null)
@@ -109,11 +109,11 @@ public class OutletConfigurationSaxHandl
                     + " configurationProvider is null");
             throw new NullPointerException("configurationProvider is null");
         }
-        if (projectPaths == null)
+        if (unitDescriptor == null)
         {
             log.error("OutletConfigurationSaxHandler: "
-                    + " projectPaths is null");
-            throw new NullPointerException("projectPaths is null");
+                    + " unitDescriptor is null");
+            throw new NullPointerException("unitDescriptor is null");
         }
         if (configurationHandlers == null)
         {
@@ -122,7 +122,7 @@ public class OutletConfigurationSaxHandl
             throw new NullPointerException("configurationHandlers is null");
         }
         this.configurationProvider = configurationProvider;
-        this.projectPaths = projectPaths;
+        this.unitDescriptor = unitDescriptor;
         this.configurationHandlers = configurationHandlers;
     }
 
@@ -180,7 +180,7 @@ public class OutletConfigurationSaxHandl
         {
             mergepointHandler = new MergepointSaxHandler(
                     configurationProvider,
-                    projectPaths,
+                    unitDescriptor,
                     configurationHandlers);
             mergepointHandler.startElement(
                     uri, localName, qName, attributes);
@@ -280,7 +280,7 @@ public class OutletConfigurationSaxHandl
                     = typedHandlerFactory.getOutletSaxHandler(
                             outletName,
                             configurationProvider,
-                            projectPaths,
+                            unitDescriptor,
                             configurationHandlers);
             return outletSaxHandler;
         }
@@ -288,7 +288,7 @@ public class OutletConfigurationSaxHandl
         for (UntypedOutletSaxHandlerFactory candidate
                 : outletTypes.getUntypedOutletHandlerFactories())
         {
-            if (candidate.canHandle(outletType))
+            if (candidate.canHandle(outletType, unitDescriptor))
             {
                 untypedHandlerFactory = candidate;
                 break;
@@ -305,7 +305,7 @@ public class OutletConfigurationSaxHandl
                         outletType,
                         outletName,
                         configurationProvider,
-                        projectPaths,
+                        unitDescriptor,
                         configurationHandlers);
         return outletSaxHandler;
     }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationXmlParser.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationXmlParser.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationXmlParser.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletConfigurationXmlParser.java Thu Mar 14 21:54:47 2013
@@ -36,7 +36,6 @@ import org.apache.torque.generator.confi
 import org.apache.torque.generator.configuration.ConfigurationProvider;
 import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.configuration.mergepoint.MergepointMapping;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
 import org.apache.torque.generator.outlet.Outlet;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
@@ -142,7 +141,7 @@ public class OutletConfigurationXmlParse
                         = readOutletConfig(
                                 inputStream,
                                 configurationProvider,
-                                unitDescriptor.getProjectPaths(),
+                                unitDescriptor,
                                 configurationHandlers);
                 allOutlets.addAll(fileContent.getOutlets());
                 allMergepointMappings.addAll(
@@ -202,7 +201,7 @@ public class OutletConfigurationXmlParse
      *        outlet configuration.
      * @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 handlers for reading the configuration,
      *        not null.
      *
@@ -217,7 +216,7 @@ public class OutletConfigurationXmlParse
     private OutletConfigFileContent readOutletConfig(
             InputStream outletConfigurationInputStream,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
         throws SAXException, IOException, ParserConfigurationException
     {
@@ -225,7 +224,7 @@ public class OutletConfigurationXmlParse
         OutletConfigurationSaxHandler saxHandler
                 = new OutletConfigurationSaxHandler(
                         configurationProvider,
-                        projectPaths,
+                        unitDescriptor,
                         configurationHandlers);
         InputSource is = new InputSource(outletConfigurationInputStream);
         parser.parse(is, saxHandler);

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletSaxHandler.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletSaxHandler.java Thu Mar 14 21:54:47 2013
@@ -28,8 +28,8 @@ import org.apache.commons.logging.LogFac
 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.UnitDescriptor;
 import org.apache.torque.generator.configuration.mergepoint.MergepointSaxHandler;
-import org.apache.torque.generator.configuration.paths.ProjectPaths;
 import org.apache.torque.generator.outlet.Outlet;
 import org.apache.torque.generator.qname.QualifiedName;
 import org.xml.sax.Attributes;
@@ -58,8 +58,8 @@ public abstract class OutletSaxHandler 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 available configuration handlers. */
     private ConfigurationHandlers configurationHandlers;
@@ -87,7 +87,7 @@ public abstract class OutletSaxHandler e
      *        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.
      *
@@ -96,7 +96,7 @@ public abstract class OutletSaxHandler e
     public OutletSaxHandler(
             QualifiedName outletName,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
     {
         if (configurationProvider == null)
@@ -105,11 +105,11 @@ public abstract class OutletSaxHandler e
                     + " configurationProvider is null");
             throw new NullPointerException("configurationProvider is null");
         }
-        if (projectPaths == null)
+        if (unitDescriptor == null)
         {
             log.error("OutletSaxHandler: "
-                    + " projectPaths is null");
-            throw new NullPointerException("projectPaths is null");
+                    + " unitDescriptor is null");
+            throw new NullPointerException("unitDescriptor is null");
         }
         if (configurationHandlers == null)
         {
@@ -119,7 +119,7 @@ public abstract class OutletSaxHandler e
         }
         this.outletName = outletName;
         this.configurationProvider = configurationProvider;
-        this.projectPaths = projectPaths;
+        this.unitDescriptor = unitDescriptor;
         this.configurationHandlers = configurationHandlers;
     }
 
@@ -160,7 +160,7 @@ public abstract class OutletSaxHandler e
         {
             mergepointSaxHandler = new MergepointSaxHandler(
                     configurationProvider,
-                    projectPaths,
+                    unitDescriptor,
                     configurationHandlers);
             mergepointSaxHandler.startElement(uri, localName, rawName, attributes);
         }
@@ -278,13 +278,13 @@ public abstract class OutletSaxHandler 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/outlet/ReflectionOutletSaxHandlerFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/ReflectionOutletSaxHandlerFactory.java?rev=1456694&r1=1456693&r2=1456694&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/ReflectionOutletSaxHandlerFactory.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/ReflectionOutletSaxHandlerFactory.java Thu Mar 14 21:54:47 2013
@@ -27,7 +27,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 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;
 
@@ -100,7 +100,7 @@ public class ReflectionOutletSaxHandlerF
      *        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.
      *
@@ -110,7 +110,7 @@ public class ReflectionOutletSaxHandlerF
             String outletType,
             QualifiedName outletName,
             ConfigurationProvider configurationProvider,
-            ProjectPaths projectPaths,
+            UnitDescriptor unitDescriptor,
             ConfigurationHandlers configurationHandlers)
          throws SAXException
     {
@@ -120,7 +120,13 @@ public class ReflectionOutletSaxHandlerF
         Class<?> handlerClass;
         try
         {
-            handlerClass = Class.forName(fullyQualifiedSaxHandlerName);
+            ClassLoader classLoader = unitDescriptor.getClassLoader();
+            if (classLoader == null)
+            {
+                classLoader = getClass().getClassLoader();
+            }
+            handlerClass = Class.forName(
+                    fullyQualifiedSaxHandlerName, true, classLoader);
         }
         catch (ClassNotFoundException e)
         {
@@ -135,7 +141,7 @@ public class ReflectionOutletSaxHandlerF
             constructor = handlerClass.getConstructor(
                 QualifiedName.class,
                 ConfigurationProvider.class,
-                ProjectPaths.class,
+                UnitDescriptor.class,
                 ConfigurationHandlers.class);
         }
         catch (NoSuchMethodException e)
@@ -144,7 +150,7 @@ public class ReflectionOutletSaxHandlerF
                     + " has no constructor for types "
                     + QualifiedName.class.getName() + ","
                     + ConfigurationProvider.class.getName() + ","
-                    + ProjectPaths.class.getName() + ","
+                    + UnitDescriptor.class.getName() + ","
                     + ConfigurationHandlers.class.getName());
         }
 
@@ -154,7 +160,7 @@ public class ReflectionOutletSaxHandlerF
             outletSaxHandler = (OutletSaxHandler) constructor.newInstance(
                     outletName,
                     configurationProvider,
-                    projectPaths,
+                    unitDescriptor,
                     configurationHandlers);
         }
         catch (IllegalArgumentException e)
@@ -183,7 +189,7 @@ public class ReflectionOutletSaxHandlerF
          return outletSaxHandler;
     }
 
-    public boolean canHandle(String type)
+    public boolean canHandle(String type, UnitDescriptor unitDescriptor)
     {
         String fullyQualifiedSaxHandlerName
                 = getFullyQualifiedHandlerClassName(type);
@@ -193,7 +199,13 @@ public class ReflectionOutletSaxHandlerF
         Class<?> handlerClass;
         try
         {
-            handlerClass = Class.forName(fullyQualifiedSaxHandlerName);
+            ClassLoader classLoader = unitDescriptor.getClassLoader();
+            if (classLoader == null)
+            {
+                classLoader = getClass().getClassLoader();
+            }
+            handlerClass = Class.forName(
+                    fullyQualifiedSaxHandlerName, true, classLoader);
         }
         catch (ClassNotFoundException e)
         {



---------------------------------------------------------------------
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