You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by tf...@apache.org on 2014/03/05 22:33:21 UTC

svn commit: r1574675 - in /db/torque/torque4/trunk/torque-generator/src: main/java/org/apache/torque/generator/configuration/controller/ main/java/org/apache/torque/generator/configuration/source/ main/java/org/apache/torque/generator/control/ main/jav...

Author: tfischer
Date: Wed Mar  5 21:33:20 2014
New Revision: 1574675

URL: http://svn.apache.org/r1574675
Log:
TORQUE-310 add simple way to remove unused imports

Added:
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/ConfigurableClassSaxHandler.java
      - copied, changed from r1470235, 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/PostprocessorDefinition.java
    db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/PostprocessorTest.java
    db/torque/torque4/trunk/torque-generator/src/test/postprocessor/
    db/torque/torque4/trunk/torque-generator/src/test/postprocessor/package.html
    db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/
    db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/
    db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/
    db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/conf/
    db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/conf/control.xml
    db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/outlets/
    db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/outlets/postprocessor.xml
    db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/src/
    db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/src/source.xml
Removed:
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceTransformerSaxHandler.java
Modified:
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/Output.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/source/SourceConfigurationTags.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/control/Controller.java
    db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/generator/configuration/configuration.xsd
    db/torque/torque4/trunk/torque-generator/src/test/configuration/src/main/torque-gen/conf/control.xml
    db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/configuration/ReadConfigurationTest.java

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/Output.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/Output.java?rev=1574675&r1=1574674&r2=1574675&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/Output.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/Output.java Wed Mar  5 21:33:20 2014
@@ -19,11 +19,15 @@ package org.apache.torque.generator.conf
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.commons.lang.StringUtils;
 import org.apache.torque.generator.control.existingtargetstrategy.ReplaceTargetFileStrategy;
 import org.apache.torque.generator.control.outputtype.UnknownOutputType;
 import org.apache.torque.generator.outlet.Outlet;
 import org.apache.torque.generator.qname.QualifiedName;
+import org.apache.torque.generator.source.PostprocessorDefinition;
 import org.apache.torque.generator.source.SourceProcessConfiguration;
 import org.apache.torque.generator.source.SourceProvider;
 
@@ -44,7 +48,7 @@ public class Output
     /**
      * The name by which this output can be identified.
      */
-    private QualifiedName name;
+    private final QualifiedName name;
 
     /**
      * The source provider to access the input for generation.
@@ -52,11 +56,17 @@ public class Output
     private SourceProvider sourceProvider;
 
     /**
-     * The information on how to post-process the sources before generation.
+     * The information on how to pre-process the sources before generation.
      */
     private SourceProcessConfiguration sourceProcessConfiguration;
 
     /**
+     * The information on how to post-process the sources after generation.
+     */
+    private final List<PostprocessorDefinition> postprocessorDefinitions
+        = new ArrayList<PostprocessorDefinition>();;
+
+    /**
      * The outlet which generates the content.
      */
     private OutletReference contentOutlet;
@@ -110,7 +120,7 @@ public class Output
      *
      * @param name the name by which this output can be identified.
      */
-    public Output(QualifiedName name)
+    public Output(final QualifiedName name)
     {
         this.name = name;
     }
@@ -143,7 +153,7 @@ public class Output
      * @param sourceProvider the source provider which provides the input for
      *        generation.
      */
-    public void setSourceProvider(SourceProvider sourceProvider)
+    public void setSourceProvider(final SourceProvider sourceProvider)
     {
         this.sourceProvider = sourceProvider;
     }
@@ -165,19 +175,31 @@ public class Output
      *      post-processing the sources.
      */
     public void setSourceProcessConfiguration(
-            SourceProcessConfiguration sourceProcessConfiguration)
+            final SourceProcessConfiguration sourceProcessConfiguration)
     {
         this.sourceProcessConfiguration = sourceProcessConfiguration;
     }
 
     /**
+     * Returns the list of postprocessors which should be applied
+     * to the generation result.
+     *
+     * @return the modifiable list of postprocessors, not null.
+     *         Changes to the returned list change this object as well.
+     */
+    public List<PostprocessorDefinition> getPostprocessorDefinitions()
+    {
+        return postprocessorDefinitions;
+    }
+
+    /**
      * Sets the name of the file to generate.
      * This is also used to store the generated filename
      * if it was generated using the filenameOutlet.
      *
      * @param filename the name of the file to generate.
      */
-    public void setFilename(String filename)
+    public void setFilename(final String filename)
     {
         this.filename = filename;
     }
@@ -210,7 +232,7 @@ public class Output
      * @param contentOutlet the reference to the outlet responsible
      *        for producing the content.
      */
-    public void setContentOutlet(OutletReference contentOutlet)
+    public void setContentOutlet(final OutletReference contentOutlet)
     {
         this.contentOutlet = contentOutlet;
     }
@@ -235,7 +257,7 @@ public class Output
      * @param filenameOutlet the reference to the outlet responsible
      *        for producing the file name.
      */
-    public void setFilenameOutlet(Outlet filenameOutlet)
+    public void setFilenameOutlet(final Outlet filenameOutlet)
     {
         this.filenameOutlet = filenameOutlet;
     }
@@ -255,7 +277,7 @@ public class Output
      *
      * @param existingTargetStrategy the strategy name.
      */
-    public void setExistingTargetStrategy(String existingTargetStrategy)
+    public void setExistingTargetStrategy(final String existingTargetStrategy)
     {
         this.existingTargetStrategy = existingTargetStrategy;
     }
@@ -279,7 +301,7 @@ public class Output
      * @param outputKeyDir the key  for the output directory,
      *        or null for the default output directory.
      */
-    public void setOutputDirKey(String outputKeyDir)
+    public void setOutputDirKey(final String outputKeyDir)
     {
         this.outputDirKey = outputKeyDir;
     }
@@ -301,7 +323,7 @@ public class Output
      * @param encoding The character encoding of the generated file,
      *        or null for the platform default encoding.
      */
-    public void setEncoding(String encoding)
+    public void setEncoding(final String encoding)
     {
         this.encoding = encoding;
     }
@@ -313,7 +335,7 @@ public class Output
      *
      * @throws NullPointerException if type is null.
      */
-    public void setType(String type)
+    public void setType(final String type)
     {
         if (type == null)
         {
@@ -346,7 +368,7 @@ public class Output
      * @param content the already produced content.
      * @return the line break character(s), one of "\r", "\n", "\r\n".
      */
-    public String getOrDetermineLineBreak(String content)
+    public String getOrDetermineLineBreak(final String content)
     {
         if (lineBreak != null)
         {

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=1574675&r1=1574674&r2=1574675&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 Wed Mar  5 21:33:20 2014
@@ -28,6 +28,7 @@ import static org.apache.torque.generato
 import static org.apache.torque.generator.configuration.controller.OutputConfigurationTags.OUTPUT_DIR_KEY_ATTRIBUTE;
 import static org.apache.torque.generator.configuration.controller.OutputConfigurationTags.OUTPUT_TAG;
 import static org.apache.torque.generator.configuration.controller.OutputConfigurationTags.TYPE_ATTRIBUTE;
+import static org.apache.torque.generator.configuration.source.SourceConfigurationTags.POSTPROCESSOR_TAG;
 import static org.apache.torque.generator.configuration.source.SourceConfigurationTags.SOURCE_TAG;
 
 import org.apache.torque.generator.configuration.ConfigurationHandlers;
@@ -36,11 +37,14 @@ import org.apache.torque.generator.confi
 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.source.ConfigurableClassSaxHandler;
 import org.apache.torque.generator.configuration.source.SourceSaxHandler;
 import org.apache.torque.generator.configuration.source.SourceSaxHandlerFactories;
 import org.apache.torque.generator.configuration.source.SourceSaxHandlerFactory;
 import org.apache.torque.generator.control.outputtype.UnknownOutputType;
+import org.apache.torque.generator.processor.string.StringProcessor;
 import org.apache.torque.generator.qname.QualifiedName;
+import org.apache.torque.generator.source.PostprocessorDefinition;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
@@ -56,13 +60,13 @@ public class OutputSaxHandler extends De
                 "org.apache.torque.generator.configuration.filenameOutlet");
 
     /** The access object for the configuration files, not null. */
-    private ConfigurationProvider configurationProvider;
+    private final ConfigurationProvider configurationProvider;
 
     /** The description of the generation unit, not null. */
-    private UnitDescriptor unitDescriptor;
+    private final UnitDescriptor unitDescriptor;
 
     /** All known configuration handlers. */
-    private ConfigurationHandlers configurationHandlers;
+    private final ConfigurationHandlers configurationHandlers;
 
     /** The output declaration which is currently parsed. */
     private Output output;
@@ -79,6 +83,10 @@ public class OutputSaxHandler extends De
      */
     private SourceSaxHandler sourceSaxHandler;
 
+    /** The handler which handles postprocessor elements. */
+    private ConfigurableClassSaxHandler<StringProcessor>
+        postprocessorSaxHandler;
+
     /**
      * The SAX handler which handles the filename outlet configuration,
      * or null if filename outlet tags need not be handled
@@ -97,9 +105,9 @@ public class OutputSaxHandler extends De
      * @throws NullPointerException if an argument is null.
      */
     public OutputSaxHandler(
-            ConfigurationProvider configurationProvider,
-            UnitDescriptor unitDescriptor,
-            ConfigurationHandlers configurationHandlers)
+            final ConfigurationProvider configurationProvider,
+            final UnitDescriptor unitDescriptor,
+            final ConfigurationHandlers configurationHandlers)
     {
         if (configurationProvider == null)
         {
@@ -137,10 +145,10 @@ public class OutputSaxHandler extends De
      */
     @Override
     public void startElement(
-            String uri,
-            String localName,
-            String rawName,
-            Attributes attributes)
+            final String uri,
+            final String localName,
+            final String rawName,
+            final Attributes attributes)
         throws SAXException
     {
         if (contentOutletSaxHandler != null)
@@ -167,6 +175,11 @@ public class OutputSaxHandler extends De
                     rawName,
                     attributes);
         }
+        else if (postprocessorSaxHandler != null)
+        {
+            postprocessorSaxHandler.startElement(
+                    uri, localName, rawName, attributes);
+        }
         else if (OUTPUT_TAG.equals(rawName))
         {
             String name = attributes.getValue(NAME_ATTRIBUTE);
@@ -238,6 +251,16 @@ public class OutputSaxHandler extends De
                     rawName,
                     attributes);
         }
+        else if (POSTPROCESSOR_TAG.equals(rawName))
+        {
+            postprocessorSaxHandler
+                    = new  ConfigurableClassSaxHandler<StringProcessor>(
+                            configurationProvider,
+                            unitDescriptor,
+                            POSTPROCESSOR_TAG);
+            postprocessorSaxHandler.startElement(
+                    uri, localName, rawName, attributes);
+        }
         else if (FILENAME_GENERATOR_TAG.equals(rawName))
         {
             OutletConfigurationSaxHandler outletConfigurationSaxHandler
@@ -268,7 +291,7 @@ public class OutputSaxHandler extends De
      * {@inheritDoc}
      */
     @Override
-    public void endElement(String uri, String localName, String rawName)
+    public void endElement(final String uri, final String localName, final String rawName)
         throws SAXException
     {
         if (contentOutletSaxHandler != null)
@@ -297,6 +320,20 @@ public class OutputSaxHandler extends De
                 sourceSaxHandler = null;
             }
         }
+        else if (postprocessorSaxHandler != null)
+        {
+            postprocessorSaxHandler.endElement(
+                    uri,
+                    localName,
+                    rawName);
+            if (postprocessorSaxHandler.isFinished())
+            {
+                output.getPostprocessorDefinitions().add(
+                    new PostprocessorDefinition(
+                        postprocessorSaxHandler.getConfiguredClass()));
+                postprocessorSaxHandler = null;
+            }
+        }
         else if (filenameOutletSaxHandler != null)
         {
             filenameOutletSaxHandler.endElement(uri, localName, rawName);
@@ -314,7 +351,7 @@ public class OutputSaxHandler extends De
      * {@inheritDoc}
      */
     @Override
-    public void characters(char[] ch, int start, int length)
+    public void characters(final char[] ch, final int start, final int length)
             throws SAXException
     {
         if (contentOutletSaxHandler != null)
@@ -330,5 +367,9 @@ public class OutputSaxHandler extends De
         {
             filenameOutletSaxHandler.characters(ch, start, length);
         }
+        else if (postprocessorSaxHandler != null)
+        {
+            postprocessorSaxHandler.characters(ch, start, length);
+        }
     }
 }

Copied: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/ConfigurableClassSaxHandler.java (from r1470235, 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/ConfigurableClassSaxHandler.java?p2=db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/ConfigurableClassSaxHandler.java&p1=db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceTransformerSaxHandler.java&r1=1470235&r2=1574675&rev=1574675&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/ConfigurableClassSaxHandler.java Wed Mar  5 21:33:20 2014
@@ -19,8 +19,7 @@ package org.apache.torque.generator.conf
  * under the License.
  */
 
-import static org.apache.torque.generator.configuration.source.SourceConfigurationTags.TRANSFORMER_CLASS_ATTRIBUTE;
-import static org.apache.torque.generator.configuration.source.SourceConfigurationTags.TRANSFORMER_TAG;
+import static org.apache.torque.generator.configuration.source.SourceConfigurationTags.CLASS_ATTRIBUTE;
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
@@ -39,18 +38,21 @@ import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
 
 /**
- * Reads a source transformer from the controller configuration file.
+ * Reads a configurable class from the controller configuration file.
  */
-public class SourceTransformerSaxHandler extends DefaultHandler
+public class ConfigurableClassSaxHandler<T> extends DefaultHandler
 {
     /** The logger for this class. */
     private static Log log = LogFactory.getLog(DefaultHandler.class);
 
     /** The description of the generation unit, not null. */
-    private UnitDescriptor unitDescriptor;
+    private final UnitDescriptor unitDescriptor;
 
-    /** The SourceTransformer which is currently configured. */
-    private SourceTransformer sourceTransformer;
+    /** The class instance which is currently configured. */
+    private T configuredClass;
+
+    /** the name of the XML Tag to process, not null. */
+    private final String tagNameToProcess;
 
     /** The current nesting level inside the processed element. */
     private int level = 0;
@@ -89,12 +91,14 @@ public class SourceTransformerSaxHandler
      * @param configurationProvider The access object for the configuration
      *        files, not null.
      * @param unitDescriptor The description of the generation unit, not null.
+     * @param tagNameToProcess the name of the XML Tag to process, not null.
      *
      * @throws NullPointerException if an argument is null.
      */
-    public SourceTransformerSaxHandler(
-            ConfigurationProvider configurationProvider,
-            UnitDescriptor unitDescriptor)
+    public ConfigurableClassSaxHandler(
+            final ConfigurationProvider configurationProvider,
+            final UnitDescriptor unitDescriptor,
+            final String tagNameToProcess)
     {
         if (configurationProvider == null)
         {
@@ -104,32 +108,37 @@ public class SourceTransformerSaxHandler
         {
             throw new NullPointerException("unitDescriptor must not be null");
         }
+        if (tagNameToProcess == null)
+        {
+            throw new NullPointerException("tagNameToProcess must not be null");
+        }
         this.unitDescriptor = unitDescriptor;
+        this.tagNameToProcess = tagNameToProcess;
     }
 
     /**
      * {@inheritDoc}
      */
     @Override
-    public void startElement(String uri, String localName, String rawName,
-                             Attributes attributes)
+    public void startElement(final String uri, final String localName, final String rawName,
+                             final Attributes attributes)
             throws SAXException
     {
         if (level == 0)
         {
             level++;
-            if (rawName.equals(TRANSFORMER_TAG))
+            if (rawName.equals(tagNameToProcess))
             {
                 String className = attributes.getValue(
-                        TRANSFORMER_CLASS_ATTRIBUTE);
+                        CLASS_ATTRIBUTE);
                 if (className == null)
                 {
                     throw new SAXException(
-                            "The attribute " + TRANSFORMER_CLASS_ATTRIBUTE
+                            "The attribute " + CLASS_ATTRIBUTE
                             + " must not be null for the element "
-                            + TRANSFORMER_TAG);
+                            + tagNameToProcess);
                 }
-                sourceTransformer = createJavaSourceTransformer(
+                configuredClass = createConfiguredClass(
                         className, unitDescriptor);
             }
             else
@@ -170,7 +179,7 @@ public class SourceTransformerSaxHandler
      * {@inheritDoc}
      */
     @Override
-    public void endElement(String uri, String localName, String rawName)
+    public void endElement(final String uri, final String localName, final String rawName)
         throws SAXException
     {
         level--;
@@ -181,12 +190,12 @@ public class SourceTransformerSaxHandler
         }
         else if (level == 1)
         {
-            if (!PropertyUtils.isWriteable(sourceTransformer, propertyName))
+            if (!PropertyUtils.isWriteable(configuredClass, propertyName))
             {
                 throw new SAXException("No setter found for property "
                         + propertyName
                         + " in class "
-                        + sourceTransformer.getClass().getName());
+                        + configuredClass.getClass().getName());
             }
             Object propertyValue;
             if (simplePropertyValue != null)
@@ -200,7 +209,7 @@ public class SourceTransformerSaxHandler
             try
             {
                 BeanUtils.copyProperty(
-                        sourceTransformer,
+                        configuredClass,
                         propertyName,
                         propertyValue);
             }
@@ -209,7 +218,7 @@ public class SourceTransformerSaxHandler
                 throw new SAXException("error while setting Property "
                         + propertyName
                         + " for java transformer "
-                        + sourceTransformer.getClass().getName()
+                        + configuredClass.getClass().getName()
                         + " with value "
                         + propertyValue.toString(),
                     e);
@@ -219,7 +228,7 @@ public class SourceTransformerSaxHandler
                 throw new SAXException("error while setting Property "
                         + propertyName
                         + " for java transformer "
-                        + sourceTransformer.getClass().getName()
+                        + configuredClass.getClass().getName()
                         + " with value "
                         + propertyValue.toString(),
                     e);
@@ -237,7 +246,7 @@ public class SourceTransformerSaxHandler
      * {@inheritDoc}
      */
     @Override
-    public void characters(char[] ch, int start, int length)
+    public void characters(final char[] ch, final int start, final int length)
             throws SAXException
     {
         if (simplePropertyValue != null)
@@ -259,14 +268,14 @@ public class SourceTransformerSaxHandler
     }
 
     /**
-     * Returns the configuration filled with the contents of the parsed snippet.
+     * Returns the configured class.
      *
-     * @return the configuration which was filled, not null if a
+     * @return the configured class, not null if a
      *         matching snippet was processed.
      */
-    public SourceTransformer getSourceTransformer()
+    public T getConfiguredClass()
     {
-        return sourceTransformer;
+        return configuredClass;
     }
 
     /**
@@ -277,26 +286,26 @@ public class SourceTransformerSaxHandler
      */
     public boolean isFinished()
     {
-        return (sourceTransformer != null && level == 0);
+        return (configuredClass != null && level == 0);
     }
 
     /**
-     * Creates an instance of a transformer.
+     * Creates an instance of the configured class.
      *
-     * @param className the name of the transformer to be created.
+     * @param className the name of the configured class to be created.
      * @param unitDescriptor The description of the generation unit, not null.
      *
-     * @return the instance of the transformer, not null.
+     * @return the instance of the configured class, not null.
      *
      * @throws ExceptionInInitializerError if an error occurs in the
-     *        initializer of the transformer.
+     *        initializer of the configured class.
      * @throws LinkageError if the linkage fails.
      * @throws SAXException if any other  error occurs during instantiation
      *         of the class.
      */
-    private static SourceTransformer createJavaSourceTransformer(
-            String className,
-            UnitDescriptor unitDescriptor)
+    private T createConfiguredClass(
+            final String className,
+            final UnitDescriptor unitDescriptor)
         throws SAXException
     {
         Class<?> transformerClass;
@@ -306,7 +315,7 @@ public class SourceTransformerSaxHandler
             if (classLoader == null)
             {
                 classLoader
-                        = SourceTransformerSaxHandler.class.getClassLoader();
+                    = ConfigurableClassSaxHandler.class.getClassLoader();
             }
             transformerClass = Class.forName(className, true, classLoader);
         }
@@ -333,12 +342,12 @@ public class SourceTransformerSaxHandler
             throw e;
         }
 
-        SourceTransformer result;
+        T result;
         try
         {
             Constructor<?> constructor
                     = transformerClass.getConstructor();
-            result = (SourceTransformer) constructor.newInstance();
+            result = (T) constructor.newInstance();
         }
         catch (NoSuchMethodException e)
         {

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceConfigurationTags.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceConfigurationTags.java?rev=1574675&r1=1574674&r2=1574675&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceConfigurationTags.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/SourceConfigurationTags.java Wed Mar  5 21:33:20 2014
@@ -49,13 +49,19 @@ public final class SourceConfigurationTa
     /** Tag name for the "transformer" tag. */
     public static final String TRANSFORMER_TAG = "transformer";
 
-    /** Tag name for the "class" attribute of the "transformer" tag. */
-    public static final String TRANSFORMER_CLASS_ATTRIBUTE = "class";
+    /**
+     * Tag name for the "class" attribute of the "transformer"
+     * and "postprocessor tags.
+     */
+    public static final String CLASS_ATTRIBUTE = "class";
 
-    /** Tag name for the "transformer" tag. */
+    /** Tag name for the "postprocessor" tag. */
+    public static final String POSTPROCESSOR_TAG = "postprocessor";
+
+    /** Tag name for the "include" tag. */
     public static final String INCLUDE_TAG = "include";
 
-    /** Tag name for the "transformer" tag. */
+    /** Tag name for the "exclude" tag. */
     public static final String EXCLUDE_TAG = "exclude";
 
     /** Tag name for the "entityReference" tag. */

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=1574675&r1=1574674&r2=1574675&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 Wed Mar  5 21:33:20 2014
@@ -34,6 +34,7 @@ import org.apache.torque.generator.confi
 import org.apache.torque.generator.source.SourceProcessConfiguration;
 import org.apache.torque.generator.source.SourceProvider;
 import org.apache.torque.generator.source.SourceTransformerDefinition;
+import org.apache.torque.generator.source.transform.SourceTransformer;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
@@ -45,13 +46,13 @@ import org.xml.sax.helpers.DefaultHandle
 public abstract class SourceSaxHandler extends DefaultHandler
 {
     /** The access object for the configuration files, not null. */
-    private ConfigurationProvider configurationProvider;
+    private final ConfigurationProvider configurationProvider;
 
     /** The description of the generation unit, not null. */
-    private UnitDescriptor unitDescriptor;
+    private final UnitDescriptor unitDescriptor;
 
     /** The known configuration handlers. */
-    private ConfigurationHandlers configurationHandlers;
+    private final ConfigurationHandlers configurationHandlers;
 
     /**
      * How a source should be processed between obtaining the original source
@@ -66,7 +67,8 @@ public abstract class SourceSaxHandler e
             = new ArrayList<SourceTransformerDefinition>();
 
     /** The handler which handles transformer elements. */
-    private SourceTransformerSaxHandler transformerSaxHandler;
+    private ConfigurableClassSaxHandler<SourceTransformer>
+        transformerSaxHandler;
 
     /** Whether this handler has completed its task. */
     private boolean finished = false;
@@ -82,9 +84,9 @@ public abstract class SourceSaxHandler e
      * @throws NullPointerException if an argument is null.
      */
     public SourceSaxHandler(
-            ConfigurationProvider configurationProvider,
-            UnitDescriptor unitDescriptor,
-            ConfigurationHandlers configurationHandlers)
+            final ConfigurationProvider configurationProvider,
+            final UnitDescriptor unitDescriptor,
+            final ConfigurationHandlers configurationHandlers)
     {
         if (configurationProvider == null)
         {
@@ -110,8 +112,8 @@ public abstract class SourceSaxHandler e
      * {@inheritDoc}
      */
     @Override
-    public void startElement(String uri, String localName, String rawName,
-                             Attributes attributes)
+    public void startElement(final String uri, final String localName, final String rawName,
+                             final Attributes attributes)
             throws SAXException
     {
         if (transformerSaxHandler != null)
@@ -122,8 +124,10 @@ public abstract class SourceSaxHandler e
         else if (TRANSFORMER_TAG.equals(rawName))
         {
             transformerSaxHandler
-                    = new SourceTransformerSaxHandler(
-                            configurationProvider, unitDescriptor);
+                    = new ConfigurableClassSaxHandler<SourceTransformer>(
+                            configurationProvider,
+                            unitDescriptor,
+                            TRANSFORMER_TAG);
             transformerSaxHandler.startElement(
                     uri, localName, rawName, attributes);
         }
@@ -155,7 +159,7 @@ public abstract class SourceSaxHandler e
      * {@inheritDoc}
      */
     @Override
-    public void endElement(String uri, String localName, String rawName)
+    public void endElement(final String uri, final String localName, final String rawName)
         throws SAXException
     {
         if (transformerSaxHandler != null)
@@ -167,7 +171,7 @@ public abstract class SourceSaxHandler e
             if (transformerSaxHandler.isFinished())
             {
                 transformerDefinitions.add(new SourceTransformerDefinition(
-                        transformerSaxHandler.getSourceTransformer()));
+                        transformerSaxHandler.getConfiguredClass()));
                 transformerSaxHandler = null;
             }
         }
@@ -184,7 +188,7 @@ public abstract class SourceSaxHandler e
      * {@inheritDoc}
      */
     @Override
-    public void characters(char[] ch, int start, int length)
+    public void characters(final char[] ch, final int start, final int length)
             throws SAXException
     {
         if (transformerSaxHandler != null)
@@ -251,7 +255,7 @@ public abstract class SourceSaxHandler e
     public abstract SourceProvider getSourceProvider();
 
     /**
-     * Returns the information how to post-process the sources after loading.
+     * Returns the information how to pre-process the sources before generating.
      *
      * @return the sourceProcessConfiguration, not null if the
      *         source snippet was processed.

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/Controller.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/Controller.java?rev=1574675&r1=1574674&r2=1574675&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/Controller.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/Controller.java Wed Mar  5 21:33:20 2014
@@ -51,6 +51,8 @@ import org.apache.torque.generator.contr
 import org.apache.torque.generator.control.existingtargetstrategy.SkipExistingTargetFileStrategy;
 import org.apache.torque.generator.outlet.Outlet;
 import org.apache.torque.generator.outlet.OutletResult;
+import org.apache.torque.generator.processor.string.StringProcessor;
+import org.apache.torque.generator.source.PostprocessorDefinition;
 import org.apache.torque.generator.source.Source;
 import org.apache.torque.generator.source.SourceException;
 import org.apache.torque.generator.source.SourcePath;
@@ -553,9 +555,21 @@ public class Controller
         }
 
         outlet.beforeExecute(controllerState);
-        final OutletResult result = outlet.execute(controllerState);
+        OutletResult result = outlet.execute(controllerState);
         outlet.afterExecute(controllerState);
 
+        if (result.isStringResult())
+        {
+            for (PostprocessorDefinition postprocessorDefinition
+                    : output.getPostprocessorDefinitions())
+            {
+                StringProcessor postprocessor
+                        = postprocessorDefinition.getPostprocessor();
+                String postprocessedResult
+                        = postprocessor.process(result.getStringResult());
+                result = new OutletResult(postprocessedResult);
+            }
+        }
         existingTargetStrategy.afterGeneration(
                 output.getOutputDirKey(),
                 output.getFilename(),

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/PostprocessorDefinition.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/PostprocessorDefinition.java?rev=1574675&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/PostprocessorDefinition.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/PostprocessorDefinition.java Wed Mar  5 21:33:20 2014
@@ -0,0 +1,100 @@
+package org.apache.torque.generator.source;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.torque.generator.processor.string.StringProcessor;
+
+/**
+ * All necessary informations for postprocessing the result.
+ * Contains the postprocessor instance.
+ *
+ * $Id: SourceTransformerDefinition.java 1470235 2013-04-20 21:23:39Z tfischer $
+ */
+public final class PostprocessorDefinition
+{
+    /**
+     * The postprocessor instance.
+     */
+    private final StringProcessor postprocessor;
+
+    /**
+     * Constructor.
+     *
+     * @param sourceTransformer the postprocessor instance, not null.
+     */
+    public PostprocessorDefinition(
+            final StringProcessor postprocessor)
+    {
+        if (postprocessor == null)
+        {
+            throw new NullPointerException(
+                    "postprocessor must not be null");
+        }
+        this.postprocessor = postprocessor;
+    }
+
+    /**
+     * Returns the postprocessor instance for this definition.
+     *
+     * @return the postprocessor instance, not null.
+     */
+    public StringProcessor getPostprocessor()
+    {
+        return postprocessor;
+    }
+
+    @Override
+    public String toString()
+    {
+        return "PostprocessorDefinition [postprocessor="
+                + postprocessor + "]";
+    }
+
+    @Override
+    public int hashCode()
+    {
+        HashCodeBuilder hashCodeBuilder = new HashCodeBuilder()
+            .append(postprocessor);
+        return hashCodeBuilder.toHashCode();
+    }
+
+    @Override
+    public boolean equals(final Object obj)
+    {
+        if (this == obj)
+        {
+            return true;
+        }
+        if (obj == null)
+        {
+            return false;
+        }
+        if (getClass() != obj.getClass())
+        {
+            return false;
+        }
+        PostprocessorDefinition other = (PostprocessorDefinition) obj;
+        EqualsBuilder equalsBuilder = new EqualsBuilder()
+            .append(postprocessor, other.postprocessor);
+        return equalsBuilder.isEquals();
+    }
+}

Modified: db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/generator/configuration/configuration.xsd
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/generator/configuration/configuration.xsd?rev=1574675&r1=1574674&r2=1574675&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/generator/configuration/configuration.xsd (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/resources/org/apache/torque/generator/configuration/configuration.xsd Wed Mar  5 21:33:20 2014
@@ -100,6 +100,7 @@
       <element name="filenameOutlet" type="configuration:baseOutlet" minOccurs="0"/>
       <element name="source" type="configuration:source"/>
       <element name="outlet" type="configuration:outletReference"/>
+      <element name="postprocessor" type="configuration:postprocessor" minOccurs="0" maxOccurs="unbounded"/>
     </sequence>
     <attribute name="name" type="string" use="required">
       <annotation>
@@ -290,6 +291,30 @@
     <attribute name="name" type="string" use="required"/>
   </complexType>
 
+  <complexType name="postprocessor">
+    <annotation>
+      <documentation>
+        Configures a postprocessor which transforms the generated output
+        after the generation. The postprocessor can be configured by adding
+        nested elements where the element name is the property name
+        and the text content the property value.
+      </documentation>
+    </annotation>
+    <sequence>
+      <any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+    </sequence>
+    <attribute name="class" type="string" use="required">
+      <annotation>
+        <documentation>
+          The fully qualified class name of a java class implementing the
+          org.apache.torque.generator.processor.string.StringProcessor
+          interface. Instances of this interface can process strings,
+          in this case the generated content is transformed.
+        </documentation>
+      </annotation>
+    </attribute>
+  </complexType>
+
   <element name="control">
     <annotation>
       <documentation>

Modified: db/torque/torque4/trunk/torque-generator/src/test/configuration/src/main/torque-gen/conf/control.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/configuration/src/main/torque-gen/conf/control.xml?rev=1574675&r1=1574674&r2=1574675&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/configuration/src/main/torque-gen/conf/control.xml (original)
+++ db/torque/torque4/trunk/torque-generator/src/test/configuration/src/main/torque-gen/conf/control.xml Wed Mar  5 21:33:20 2014
@@ -49,12 +49,16 @@
         format="properties"
         combineFiles="true"
         skipDecider="org.apache.torque.generator.configuration.ConfigurationTestSkipDecider">
-      <transformer class="org.apache.torque.generator.configuration.ConfigurationTestTransformer" />
+      <transformer class="org.apache.torque.generator.configuration.ConfigurationTestTransformer"/>
       <transformer class="org.apache.torque.generator.configuration.OtherConfigurationTestTransformer" />
       <include>second.source.path.properties</include>
       <exclude>second.excluded.properties</exclude>
     </source>
     <outlet name="org.apache.torque.generator.test.readConfiguration.anotherOutlet"/>
+    <postprocessor class="org.apache.torque.generator.processor.string.CharReplacer">
+      <toReplaceWith>x</toReplaceWith>
+    </postprocessor>
+    <postprocessor class="org.apache.torque.generator.processor.string.UnixLinefeedProcessor" />
   </output>
   <output name="thirdOutput" file="outputFileName" existingTargetStrategy="append" outputDirKey="thirdOutputDirKey">
     <source xsi:type="jdbcMetadataSource"

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=1574675&r1=1574674&r2=1574675&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 Wed Mar  5 21:33:20 2014
@@ -60,6 +60,8 @@ import org.apache.torque.generator.optio
 import org.apache.torque.generator.option.OptionImpl;
 import org.apache.torque.generator.option.Options;
 import org.apache.torque.generator.outlet.Outlet;
+import org.apache.torque.generator.processor.string.CharReplacer;
+import org.apache.torque.generator.processor.string.UnixLinefeedProcessor;
 import org.apache.torque.generator.qname.QualifiedName;
 import org.apache.torque.generator.source.SourceProcessConfiguration;
 import org.apache.torque.generator.source.SourceTransformerDefinition;
@@ -320,6 +322,16 @@ public class ReadConfigurationTest exten
                             sourceProcessConfiguration,
                             output.getSourceProcessConfiguration());
                 }
+                {
+                    assertEquals(2, output.getPostprocessorDefinitions().size());
+                    assertEquals(
+                            CharReplacer.class,
+                            output.getPostprocessorDefinitions().get(0).getPostprocessor().getClass());
+                    assertEquals("x", ((CharReplacer) output.getPostprocessorDefinitions().get(0).getPostprocessor()).getToReplaceWith());
+                    assertEquals(
+                            UnixLinefeedProcessor.class,
+                            output.getPostprocessorDefinitions().get(1).getPostprocessor().getClass());
+                }
             }
             {
                 Output output = outputFiles.get(2);

Added: db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/PostprocessorTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/PostprocessorTest.java?rev=1574675&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/PostprocessorTest.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/test/java/org/apache/torque/generator/control/PostprocessorTest.java Wed Mar  5 21:33:20 2014
@@ -0,0 +1,65 @@
+package org.apache.torque.generator.control;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.torque.generator.BaseTest;
+import org.apache.torque.generator.configuration.UnitDescriptor;
+import org.apache.torque.generator.configuration.paths.CustomProjectPaths;
+import org.apache.torque.generator.configuration.paths.DefaultTorqueGeneratorPaths;
+import org.apache.torque.generator.configuration.paths.Maven2DirectoryProjectPaths;
+import org.junit.Test;
+
+/**
+ * Tests whether postprocessing works as expected.
+ */
+public class PostprocessorTest extends BaseTest
+{
+    @Test
+    public void testOutputEncoding() throws Exception
+    {
+        File targetDir = new File("target/test/postprocessor");
+        FileUtils.deleteDirectory(targetDir);
+        Controller controller = new Controller();
+        List<UnitDescriptor> unitDescriptors = new ArrayList<UnitDescriptor>();
+        CustomProjectPaths projectPaths = new CustomProjectPaths(
+                new Maven2DirectoryProjectPaths(
+                        new File("src/test/postprocessor")));
+        projectPaths.setOutputDirectory(null, targetDir);
+        unitDescriptors.add(new UnitDescriptor(
+                UnitDescriptor.Packaging.DIRECTORY,
+                projectPaths,
+                new DefaultTorqueGeneratorPaths()));
+        controller.run(unitDescriptors);
+
+        assertTrue(targetDir.exists());
+        File targetFile = new File(targetDir, "output.txt");
+        assertTrue(targetFile.exists());
+        String content = FileUtils.readFileToString(targetFile, "ISO-8859-1");
+        assertEquals("Test Outlet outputy foo=yyyy bar=bar", content);
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/test/postprocessor/package.html
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/postprocessor/package.html?rev=1574675&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/postprocessor/package.html (added)
+++ db/torque/torque4/trunk/torque-generator/src/test/postprocessor/package.html Wed Mar  5 21:33:20 2014
@@ -0,0 +1,24 @@
+<!--
+ Copyright 2001-2006 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License")
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<h2>Test configuration for the PostprocessorTest</h2>
+
+<p>
+  This directory and its subdirectories contain a test configuration
+  which is used by the PostprocessorTest to check whether
+  postprocessors work as expected.
+</p>
+ 
\ No newline at end of file

Added: db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/conf/control.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/conf/control.xml?rev=1574675&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/conf/control.xml (added)
+++ db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/conf/control.xml Wed Mar  5 21:33:20 2014
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<control
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://db.apache.org/torque/4.0/generator/configuration http://db.apache.org/torque/4.0/generator/configuration.xsd"
+    xmlns="http://db.apache.org/torque/4.0/generator/configuration">
+
+  <output name="output" file="output.txt">
+    <source xsi:type="fileSource">
+      <include>source.xml</include>
+    </source>
+    <outlet name="org.apache.torque.generator.test.outputencoding.javaOutlet"/>
+    <postprocessor class="org.apache.torque.generator.processor.string.CharReplacer">
+      <toReplaceWith>x</toReplaceWith>
+    </postprocessor>
+    <postprocessor class="org.apache.torque.generator.processor.string.CharReplacer">
+      <toReplace>x</toReplace>
+      <toReplaceWith>y</toReplaceWith>
+    </postprocessor>
+  </output>
+</control>
+  
\ No newline at end of file

Added: db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/outlets/postprocessor.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/outlets/postprocessor.xml?rev=1574675&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/outlets/postprocessor.xml (added)
+++ db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/outlets/postprocessor.xml Wed Mar  5 21:33:20 2014
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<torqueGenConf:outlets xmlns="http://db.apache.org/torque/4.0/generator/configuration"
+    xmlns:torqueGenConf="http://db.apache.org/torque/4.0/generator/configuration"
+    xsi:schemaLocation="http://db.apache.org/torque/4.0/generator/configuration http://db.apache.org/torque/4.0/generator/configuration.xsd"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <outlet name="org.apache.torque.generator.test.outputencoding.javaOutlet"
+      xsi:type="javaOutlet" 
+      class="org.apache.torque.generator.java.JavaOutlet">
+    <input elementName="source"/>
+    <foo>-.;</foo>
+    <bar>bar</bar>
+  </outlet>
+</torqueGenConf:outlets>
\ No newline at end of file

Added: db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/src/source.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/src/source.xml?rev=1574675&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/src/source.xml (added)
+++ db/torque/torque4/trunk/torque-generator/src/test/postprocessor/src/main/torque-gen/src/source.xml Wed Mar  5 21:33:20 2014
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<source>
+</source>



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