db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r910600 [9/29] - in /db/torque/torque4/trunk: maven-torque-gf-plugin/ maven-torque-gf-plugin/src/ maven-torque-gf-plugin/src/main/ maven-torque-gf-plugin/src/main/java/ maven-torque-gf-plugin/src/main/java/org/ maven-torque-gf-plugin/src/ma...
Date Tue, 16 Feb 2010 17:16:02 GMT
Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/ConstantNameGenerator.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/ConstantNameGenerator.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/ConstantNameGenerator.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/ConstantNameGenerator.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,65 @@
+package org.apache.torque.gf.generator.java;
+
+/*
+ * 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.torque.gf.control.ControllerState;
+import org.apache.torque.gf.generator.GeneratorException;
+import org.apache.torque.gf.processor.string.ConstantNameCreator;
+import org.apache.torque.gf.qname.QualifiedName;
+
+/**
+ * Creates the name of a constant from a string. All letters in the String are
+ * capitalized, and underscores (_) are used as separators per default.
+ */
+public class ConstantNameGenerator extends StringInputGenerator
+{
+    /**
+     * The processor which does the character replacement.
+     */
+    private ConstantNameCreator constantNameCreator = new ConstantNameCreator();
+
+    /**
+     * Constructor.
+     *
+     * @param qualifiedName the unique name of the generator, not null.
+     */
+    public ConstantNameGenerator(QualifiedName qualifiedName)
+    {
+        super(qualifiedName);
+    }
+
+    /**
+     * Processes the input according to the camelback rules.
+     *
+     * @param controllerState the current state of the controller, not null.
+     *
+     * @throws GeneratorException in processing fails.
+     */
+    @Override
+    public String execute(ControllerState controllerState)
+            throws GeneratorException
+    {
+        String input = getInput(controllerState);
+
+        String result = constantNameCreator.process(input);
+
+        return result;
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/GeneratorUtils.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/GeneratorUtils.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/GeneratorUtils.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/GeneratorUtils.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,228 @@
+package org.apache.torque.gf.generator.java;
+
+/*
+ * 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.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.torque.gf.control.ControllerState;
+import org.apache.torque.gf.generator.GeneratorException;
+import org.apache.torque.gf.qname.Namespace;
+import org.apache.torque.gf.qname.QualifiedName;
+import org.apache.torque.gf.source.SourceElement;
+import org.apache.torque.gf.source.SourcePath;
+import org.apache.torque.gf.variable.Variable;
+
+/**
+ * Utility methods to retrieve information out of the source model or the
+ * configuration. The methods provide adequate logging and error handling.
+ */
+public final class GeneratorUtils
+{
+    /**
+     * Private constructor for utility class.
+     */
+    private GeneratorUtils()
+    {
+    }
+
+    /** The logger for the class. */
+    private static Log log = LogFactory.getLog(GeneratorUtils.class);
+
+    /**
+     * Retrieves the value of a source element attribute. The source element
+     * must be found and the attribute must be set, otherwise an exception is
+     * thrown.
+     *
+     * @param elementName The name of the source element relative to the
+     *        current source element; a dot (.) denotes the current element.
+     * @param attributeName The name of the attribute of the element.
+     * @param controllerState The controller state.
+     * @param clazz the class in which the attribute should be retrieved;
+     *        used only for logging.
+     *
+     * @return the value of the specified attribute, not null.
+     *
+     * @throws GeneratorException if the source element cannot be found
+     *         or the specified attribute is not set.
+     */
+    public static String getSourceElementAttribute(
+            String elementName,
+            String attributeName,
+            ControllerState controllerState,
+            Class<?> clazz)
+        throws GeneratorException
+    {
+        SourceElement sourceElement = SourcePath.getElement(
+                controllerState.getSourceElement(),
+                elementName,
+                false);
+        Object attribute
+                = sourceElement.getAttribute(attributeName);
+        if (attribute == null)
+        {
+            throw new GeneratorException(
+                    "Source element attribute not set in "
+                    + clazz.getName()
+                    + "\n"
+                    + "The attribute "
+                    + attributeName
+                    + " of the source element "
+                    + elementName
+                    + " is not set.");
+        }
+        return attribute.toString();
+    }
+
+    /**
+     * Reads an option with a given name. The option must be set to a value
+     * different from null.
+     *
+     * @param optionName the name of the option to read, not null.
+     * @param controllerState the current state of the controller, not null.
+     * @param clazz the class from which this method is called, not null.
+     *        Only used for logging purposes.
+     *
+     * @return the value of the option.
+     *
+     * @throws GeneratorException if the option is not set or set to null.
+     */
+    public static String getOption(
+            String optionName,
+            ControllerState controllerState,
+            Class<?> clazz)
+        throws GeneratorException
+    {
+        Object optionValue = controllerState.getOption(optionName);
+        if (optionValue == null)
+        {
+            throw new GeneratorException("Invalid configuration of "
+                    + clazz.getName()
+                    + "\n"
+                    + "The option "
+                    + optionName
+                    + " is not set.");
+        }
+        return optionValue.toString();
+    }
+
+    /**
+     * Retrieve a value from either a preset value, an option, a variable,
+     * or a source element attribute. Exactly one of these must be set to a
+     * value different from zero.
+     *
+     * @param presetValue the plain result, or null if the preset value should
+     *        not be used.
+     * @param optionName the name of the option to access, or null if
+     *        no option value should be returned.
+     * @param variableName the name of the variable to access, or null if
+     *        no variable should be accessed.
+     * @param sourceElementName the name of the source element relative to the
+     *        current element which attribute should be read. Null if no source
+     *        attribute value should be used.
+     * @param sourceElementAttribute the name of the attribute of the above
+     *        source element.
+     * @param controllerState the current state of the controller, not null.
+     * @param clazz the class from which this method is called, not null.
+     *        Used only for logging purposes.
+     * @param expectedFieldNames the field names in which the information
+     *        is expected; for logging purposes only.
+     *
+     * @return the desired value, not null.
+     *
+     * @throws GeneratorException if the value is not set or more than one
+     *         possibility to get the value exists.
+     */
+    public static String getFromDifferentPlaces(
+            String presetValue,
+            String optionName,
+            String variableName,
+            String sourceElementName,
+            String sourceElementAttribute,
+            ControllerState controllerState,
+            Class<?> clazz,
+            String expectedFieldNames)
+        throws GeneratorException
+    {
+        if (optionName != null
+                && sourceElementName == null
+                && presetValue == null
+                && variableName == null)
+        {
+             return GeneratorUtils.getOption(
+                     optionName,
+                     controllerState,
+                     clazz);
+        }
+        else if (sourceElementName != null
+                && optionName == null
+                && presetValue == null
+                && variableName == null)
+        {
+             return GeneratorUtils.getSourceElementAttribute(
+                     sourceElementName,
+                     sourceElementAttribute,
+                     controllerState,
+                     clazz);
+        }
+        else if (variableName != null
+                && sourceElementName == null
+                && optionName == null
+                && presetValue == null)
+        {
+            Namespace namespace
+                    = controllerState.getGenerator().getName().getNamespace();
+            QualifiedName variableQualifiedName = new QualifiedName(
+                    variableName,
+                    namespace);
+            Variable variable
+                    = controllerState.getVariableStore().getInHierarchy(
+                            variableQualifiedName);
+            if (variable == null)
+            {
+                log.info("clazz.getName() : Variable " + variableQualifiedName
+                        + " is not set, returning the empty String");
+                return "";
+            }
+            if (variable.getValue() == null)
+            {
+                log.info("clazz.getName() : Variable " + variableQualifiedName
+                        + " is set to null, returning the empty String");
+                return "";
+            }
+            return variable.getValue().toString();
+        }
+        else if (presetValue != null
+                && sourceElementName == null
+                && optionName == null
+                && variableName == null)
+        {
+            return presetValue;
+        }
+        else
+        {
+            throw new GeneratorException("Invalid configuration of "
+                    + clazz.getName()
+                    + "\n"
+                    + "Make sure that one and only one of "
+                    + expectedFieldNames
+                    + " are set.");
+        }
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/GeneratorWithoutMergepoints.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/GeneratorWithoutMergepoints.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/GeneratorWithoutMergepoints.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/GeneratorWithoutMergepoints.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,58 @@
+package org.apache.torque.gf.generator.java;
+
+/*
+ * 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.torque.gf.configuration.ConfigurationException;
+import org.apache.torque.gf.configuration.mergepoint.MergepointMapping;
+import org.apache.torque.gf.generator.GeneratorImpl;
+import org.apache.torque.gf.qname.QualifiedName;
+
+/**
+ * A generator without mergepoints.
+ */
+public abstract class GeneratorWithoutMergepoints extends GeneratorImpl
+{
+    /**
+     * Constructs a GeneratorWithoutMergepoints with the given name.
+     *
+     * @param name the name of this generator, not null.
+     *
+     * @throws NullPointerException if name is null.
+     */
+    public GeneratorWithoutMergepoints(QualifiedName name)
+    {
+        super(name);
+    }
+
+    @Override
+    public final void addMergepointMapping(MergepointMapping mergepointMapping)
+            throws ConfigurationException
+    {
+        throw new UnsupportedOperationException(
+                "The generator " + getClass().getName()
+                    + " does not support mergepoints");
+    }
+
+    @Override
+    public final MergepointMapping getMergepointMapping(String name)
+    {
+        return null;
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/JavaFilenameGenerator.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/JavaFilenameGenerator.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/JavaFilenameGenerator.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/JavaFilenameGenerator.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,69 @@
+package org.apache.torque.gf.generator.java;
+
+/*
+ * 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.torque.gf.control.ControllerState;
+import org.apache.torque.gf.generator.GeneratorException;
+import org.apache.torque.gf.generator.GeneratorImpl;
+import org.apache.torque.gf.qname.QualifiedName;
+
+/**
+ * Takes a class name and a package name as input and generates a
+ * filename(including path for package) for a java file from it.
+ */
+public class JavaFilenameGenerator extends GeneratorImpl
+{
+    /**
+     * The name of the merge point which provides the class name.
+     */
+    public static final String PACKAGE_MERGEPOINT_NAME = "package";
+
+    /**
+     * The name of the merge point which provides the file name.
+     */
+    public static final String CLASSNAME_MERGEPOINT_NAME = "classname";
+
+
+    /**
+     * Constructor.
+     *
+     * @param qualifiedName the qualified name of the generator, not null.
+     */
+    public JavaFilenameGenerator(QualifiedName qualifiedName)
+    {
+        super(qualifiedName);
+    }
+
+    @Override
+    public String execute(ControllerState controllerState)
+            throws GeneratorException
+    {
+        String packageName
+                = mergepoint(PACKAGE_MERGEPOINT_NAME, controllerState);
+        String className
+                = mergepoint(CLASSNAME_MERGEPOINT_NAME, controllerState);
+
+        String result = packageName.replace('.', '/')
+                + "/"
+                + className
+                + ".java";
+        return result;
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/ModifySourcenameGenerator.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/ModifySourcenameGenerator.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/ModifySourcenameGenerator.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/ModifySourcenameGenerator.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,239 @@
+package org.apache.torque.gf.generator.java;
+
+/*
+ * 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 java.io.File;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.apache.torque.gf.control.ControllerState;
+import org.apache.torque.gf.generator.GeneratorException;
+import org.apache.torque.gf.generator.GeneratorImpl;
+import org.apache.torque.gf.qname.QualifiedName;
+
+/**
+ * Creates a target filename from a source filename.
+ */
+public class ModifySourcenameGenerator extends GeneratorImpl
+{
+    /**
+     * The prefix which should be added at the beginning of the target filename.
+     */
+    private String prefix = "";
+
+    /**
+     * The suffix which should be added at the end of the target filename.
+     */
+    private String suffix = "";
+
+    /**
+     * Character sequence after which the source file should be discarded.
+     * The character sequence itself is also discarded.
+     */
+    private String discardFrom = null;
+
+    /**
+     * Character sequence up to which the source file should be discarded.
+     * The character sequence itself is also discarded.
+     */
+    private String discardTo = null;
+
+    /** The logger of the class. */
+    private static Logger logger
+            = Logger.getLogger(ModifySourcenameGenerator.class);
+
+    /**
+     * Constructor.
+     *
+     * @param qualifiedName the qualified name of the generator, not null.
+     */
+    public ModifySourcenameGenerator(QualifiedName qualifiedName)
+    {
+        super(qualifiedName);
+    }
+
+    @Override
+    public String execute(ControllerState controllerState)
+            throws GeneratorException
+    {
+
+        final String sourceName;
+        {
+            File sourceFile = controllerState.getSourceFile();
+            if (sourceFile == null)
+            {
+                logger.warn("execute(): sourceFile is null, "
+                        + "returning the empty String");
+                return "";
+            }
+            sourceName = sourceFile.getName();
+        }
+
+        int startFrom = 0;
+        int endAt = sourceName.length();
+        if (!StringUtils.isEmpty(discardTo))
+        {
+            int position = sourceName.lastIndexOf(discardTo);
+            if (position != -1)
+            {
+                startFrom = position + discardTo.length();
+            }
+        }
+        if (!StringUtils.isEmpty(discardFrom))
+        {
+            int position = sourceName.indexOf(discardFrom);
+            if (position != -1)
+            {
+                endAt = position;
+            }
+        }
+        String result;
+        if (startFrom <= endAt)
+        {
+            result = sourceName.substring(startFrom, endAt);
+        }
+        else
+        {
+            logger.debug("execute(): startFrom is later than endAt, "
+                    + "returning the empty String");
+            result = "";
+        }
+        result = prefix + result + suffix;
+        return result;
+    }
+
+    /**
+     * Returns the prefix which is added in front of the modified source
+     * filename.
+     *
+     * @return the prefix, not null
+     */
+    public String getPrefix()
+    {
+        return prefix;
+    }
+
+    /**
+     * Sets the prefix which is added in front of the modified source
+     * filename.
+     *
+     * @param prefix the prefix, not null.
+     *
+     * @throws NullPointerException if prefix is null.
+     */
+    public void setPrefix(String prefix)
+    {
+        if (prefix == null)
+        {
+            throw new NullPointerException("prefix is null");
+        }
+        this.prefix = prefix;
+    }
+
+    /**
+     * Returns the suffix which is added after the modified source
+     * filename.
+     *
+     * @return the suffix, not null.
+     */
+    public String getSuffix()
+    {
+        return suffix;
+    }
+
+    /**
+     * Sets the suffix which is added after the modified source
+     * filename.
+     *
+     * @param suffix the suffix, not null
+     *
+     * @throws NullPointerException if suffix is null.
+     */
+    public void setSuffix(String suffix)
+    {
+        if (suffix == null)
+        {
+            throw new NullPointerException("suffix is null");
+        }
+        this.suffix = suffix;
+    }
+
+    /**
+     * Returns the character sequence which separates the discarded beginning
+     * of the source filename from the returned end.
+     * <p>
+     * Example: if the source filename is "xyz.a.b.c", and discardFrom is ".",
+     * then "xyz" will be returned.
+     *
+     * @return the character sequence from whose first occurrence the
+     *         source filename is discarded.
+     */
+    public String getDiscardFrom()
+    {
+        return discardFrom;
+    }
+
+    /**
+     * Sets the character sequence which separates the discarded beginning
+     * of the source filename from the returned end.
+     * <p>
+     * Example: if the source filename is "xyz.a.b.c", and discardFrom is ".",
+     * then "xyz" will be returned.
+     *
+     * @param discardFrom the character sequence from whose first occurrence the
+     *         source filename is discarded.
+     */
+    public void setDiscardFrom(String discardFrom)
+    {
+        this.discardFrom = discardFrom;
+    }
+
+    /**
+     * The character sequence from the beginning of the source filename
+     * to and including the last occurrence of the returned string is discarded
+     * for the result.
+     * <p>
+     * Example: if the source filename is "xyz.a.b.c", and discardTo is ".",
+     * then "c" will be returned.
+     *
+     * @return the character sequence up to whose last occurrence the
+     *         source filename is discarded.
+     */
+    public String getDiscardTo()
+    {
+        return discardTo;
+    }
+
+    /**
+     * Sets the character sequence after which last occurrence the source
+     * filename is returned.
+     * <p>
+     * Example: if the source filename is "xyz.a.b.c", and discardTo is ".",
+     * then "c" will be returned.
+     *
+     * @param discardTo the character sequence up to whose last occurrence the
+     *         source filename is discarded.
+     */
+    public void setDiscardTo(String discardTo)
+    {
+        this.discardTo = discardTo;
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/NewlineGenerator.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/NewlineGenerator.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/NewlineGenerator.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/NewlineGenerator.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,113 @@
+package org.apache.torque.gf.generator.java;
+
+/*
+ * 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.torque.gf.control.ControllerState;
+import org.apache.torque.gf.generator.GeneratorException;
+import org.apache.torque.gf.qname.QualifiedName;
+
+/**
+ * Creates new lines (\n or \r\n).
+ */
+public class NewlineGenerator extends GeneratorWithoutMergepoints
+{
+    /** The carriage return char '\r'. */
+    public static final char CARRIAGE_RETURN = '\r';
+
+    /** The newline char '\r'. */
+    public static final char NEWLINE = '\n';
+
+    /** How many new lines should be added; */
+    private int count = 1;
+
+    /** Whether windows Style ("\r\n") should be used instead of '\n'. */
+    private boolean windowsStyle = false;
+
+    /**
+     * Constructor.
+     *
+     * @param name the qualified name of the generator.
+     */
+    public NewlineGenerator(QualifiedName name)
+    {
+        super(name);
+    }
+
+    @Override
+    public String execute(ControllerState controllerState)
+            throws GeneratorException
+    {
+        if (count < 0)
+        {
+            throw new GeneratorException("count must not be < 0");
+        }
+
+        StringBuilder result = new StringBuilder();
+        for (int i = 0; i < count; ++i)
+        {
+            if (windowsStyle)
+            {
+                result.append(CARRIAGE_RETURN);
+            }
+            result.append(NEWLINE);
+        }
+        return result.toString();
+    }
+
+    /**
+     * Returns how many newlines should be created.
+     *
+     * @return how many newlines should be created.
+     */
+    public int getCount()
+    {
+        return count;
+    }
+
+    /**
+     * Sets how many newlines should be created.
+     *
+     * @param count how many newlines should be created.
+     */
+    public void setCount(int count)
+    {
+        this.count = count;
+    }
+
+    /**
+     * Returns whether windows newlines (\r\n) are used.
+     *
+     * @return whether windows newlines are used.
+     */
+    public boolean isWindowsStyle()
+    {
+        return windowsStyle;
+    }
+
+    /**
+     * Sets whether windows newlines (\r\n) are used.
+     *
+     * @param windowsStyle whether windows newlines should be used.
+     */
+    public void setWindowsStyle(boolean windowsStyle)
+    {
+        this.windowsStyle = windowsStyle;
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/PackageToPathGenerator.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/PackageToPathGenerator.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/PackageToPathGenerator.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/PackageToPathGenerator.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,53 @@
+package org.apache.torque.gf.generator.java;
+
+/*
+ * 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.torque.gf.control.ControllerState;
+import org.apache.torque.gf.generator.GeneratorException;
+import org.apache.torque.gf.qname.QualifiedName;
+
+/**
+ * Takes a package as input and generates a path from it.
+ */
+public class PackageToPathGenerator extends StringInputGenerator
+{
+    /**
+     * Constructor for use in child classes.
+     *
+     * @param qualifiedName the fully qualified name of the generator.
+     */
+    public PackageToPathGenerator(QualifiedName qualifiedName)
+    {
+        super(qualifiedName);
+    }
+
+    /**
+     * Reads the input and replaces all dots by slashes.
+     *
+     * @see org.apache.torque.gf.generator.Generator#execute(ControllerState)
+     */
+    @Override
+    public String execute(ControllerState controllerState)
+            throws GeneratorException
+    {
+        String packagenameInput = getInput(controllerState);
+        return packagenameInput.replace('.', '/');
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/StringInputGenerator.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/StringInputGenerator.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/StringInputGenerator.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/StringInputGenerator.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,152 @@
+package org.apache.torque.gf.generator.java;
+
+/*
+ * 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.torque.gf.control.ControllerState;
+import org.apache.torque.gf.generator.GeneratorException;
+import org.apache.torque.gf.qname.QualifiedName;
+
+/**
+ * A base class for a generator which takes a String as input
+ * (not a Source Element as a normal generator would).
+ */
+public abstract class StringInputGenerator extends GeneratorWithoutMergepoints
+{
+    /**
+     * The direct input.
+     */
+    private String inputValue;
+
+    /**
+     * The source element which contains the attribute for the input,
+     * relative to the current source element. A dot (.) denotes the current
+     * source element itself.
+     */
+    private String inputSourceElement;
+
+    /**
+     * The source element attribute which contains the input.
+     */
+    private String sourceElementAttribute;
+
+    /**
+     * The option which should be used as input.
+     */
+    private String inputOption;
+
+    /**
+     * The variable which should be used as input.
+     */
+    private String inputVariable;
+
+    /**
+     * Constructs a singleInputGenerator.
+     *
+     * @param qualifiedName the name of the generator.
+     */
+    public StringInputGenerator(QualifiedName qualifiedName)
+    {
+        super(qualifiedName);
+    }
+
+    /**
+     * Sets the input value directly.
+     *
+     * @param inputValue the input value, or null if the direct input value
+     *        should not be used.
+     */
+    public void setInputValue(String inputValue)
+    {
+        this.inputValue = inputValue;
+    }
+
+    /**
+     * Sets the name of the option which should be used as input.
+     *
+     * @param inputOption the name of the option which contains the input,
+     *        or null if no option should be used as input.
+     */
+    public void setInputOption(String inputOption)
+    {
+        this.inputOption = inputOption;
+    }
+
+    /**
+     * Sets the name of the variable which should be used as input.
+     *
+     * @param inputVariable the name of the variable which should be used as
+     *        input, or null if no variable should be used as input.
+     */
+    public void setInputVariable(String inputVariable)
+    {
+        this.inputVariable = inputVariable;
+    }
+
+    /**
+     * Sets the name of the source element which contains the attribute
+     * which should be used as input.
+     *
+     * @param inputSourceElement the name of the source element, or null if
+     *        no source element should be used as input.
+     */
+    public void setInputSourceElement(String inputSourceElement)
+    {
+        this.inputSourceElement = inputSourceElement;
+    }
+
+    /**
+     * Sets the name of the source element attribute from which the input
+     * should be read. Only used if inputsourceElement is not null.
+     *
+     * @param sourceElementAttribute the attribute from which the input is
+     *        read.
+     */
+    public void setSourceElementAttribute(String sourceElementAttribute)
+    {
+        this.sourceElementAttribute = sourceElementAttribute;
+    }
+
+    /**
+     * Retrieves the input from the different possibilities nputValue,
+     * inputOption, inputVariable, or inputSourceElement.
+     *
+     * @param controllerState the current controller state.
+     *
+     * @return the retrieved value, not null.
+     *
+     * @throws GeneratorException if no possibility or more than one possibility
+     *         is chosen, or if the desired input is not set(except when a
+     *         variable is not set or set to null, this results in "" being
+     *         returned)
+     */
+    protected String getInput(ControllerState controllerState)
+        throws GeneratorException
+    {
+        return GeneratorUtils.getFromDifferentPlaces(
+                inputValue,
+                inputOption,
+                inputVariable,
+                inputSourceElement,
+                sourceElementAttribute,
+                controllerState,
+                getClass(),
+                "inputValue, inputOption, inputVariable, or inputSourceElement");
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/package.html
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/package.html?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/package.html (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/java/package.html Tue Feb 16 17:15:43 2010
@@ -0,0 +1,26 @@
+<!--
+ 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.
+-->
+<html>
+  <head>
+    <title>Torque-gf java generators</title>
+  </head>
+  <body>
+    <p>
+      This package defines java generators and provides some implementations
+      for different purposes.
+    </p>
+  </body>
+</html>

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/package.html
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/package.html?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/package.html (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/generator/package.html Tue Feb 16 17:15:43 2010
@@ -0,0 +1,25 @@
+<!--
+ 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.
+-->
+<html>
+  <head>
+    <title>Torque-gf generators</title>
+  </head>
+  <body>
+    <p>
+      This package defines torque-gf generators.
+    </p>
+  </body>
+</html>

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/Option.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/Option.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/Option.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/Option.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,43 @@
+package org.apache.torque.gf.option;
+
+/*
+ * 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.torque.gf.qname.QualifiedName;
+
+/**
+ * An option used in the code generation process.
+ * It has got a name, a value, and a context where it belongs to.
+ */
+public interface Option
+{
+    /**
+     * Returns the qualified name of the option.
+     *
+     * @return the qualified name of the option, not null.
+     */
+    QualifiedName getQualifiedName();
+
+    /**
+     * Returns the value of the option.
+     *
+     * @return the value of the option, may be null.
+     */
+    Object getValue();
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/OptionImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/OptionImpl.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/OptionImpl.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/OptionImpl.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,178 @@
+package org.apache.torque.gf.option;
+
+/*
+ * 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.torque.gf.qname.Namespace;
+import org.apache.torque.gf.qname.QualifiedName;
+
+/**
+ * The default implementation of the option Interface. This class is immutable.
+ */
+public class OptionImpl implements Option
+{
+    /**
+     * The qualified name of the option, including the name and the context.
+     */
+    private QualifiedName qualifiedName;
+
+    /**
+     * The value of the option.
+     */
+    private Object value;
+
+    /**
+     * Constructs an optionImpl from a namespace, a name and a value.
+     *
+     * @param namespace the namespace of the option, may be null.
+     * @param name the name of the option, must not be empty.
+     * @param value the value of the option, may be null.
+     */
+    public OptionImpl(String namespace, String name, Object value)
+    {
+        this.qualifiedName = new QualifiedName(namespace, name);
+        this.value = value;
+    }
+
+    /**
+     * Constructs an OptionImpl from the String representation of
+     * a QualifiedName and a value.
+     *
+     * @param qualifiedName The String representation of the qualified name
+     *        of the option, in the form context:name or name.
+     *        (in the latter case, context is null).
+     * @param value the value of the option, may be null.
+     *
+     * @throws IllegalArgumentException if qualifiedName is not a legal
+     *         QualifiedName.
+     */
+    public OptionImpl(String qualifiedName, Object value)
+    {
+        this(new QualifiedName(qualifiedName, Namespace.ROOT_NAMESPACE), value);
+    }
+
+    /**
+     * Constructs an OptionImpl from a QualifiedaName and a value.
+     * @param qualifiedName A qualifiedName containing the context
+     *        and the name of the option.
+     * @param value the value of the option, may be null.
+     */
+    public OptionImpl(QualifiedName qualifiedName, Object value)
+    {
+        if (qualifiedName == null)
+        {
+            throw new IllegalArgumentException(
+                    "qualifiedName must not be zero");
+        }
+        this.qualifiedName = qualifiedName;
+        this.value = value;
+    }
+
+    /**
+     * Returns the qualified name of the option.
+     *
+     * @return the qualified name of the option, not null.
+     */
+    public QualifiedName getQualifiedName()
+    {
+        return qualifiedName;
+    }
+
+    /**
+     * Retursn the value of the option.
+     *
+     * @return the value of the option, may be null.
+     */
+    public Object getValue()
+    {
+        return value;
+    }
+
+    /**
+     * Creates as String representation of this Object for
+     * debugging purposes.
+     *
+     * @return A String representation, not null.
+     */
+    @Override
+    public String toString()
+    {
+        StringBuilder result = new StringBuilder()
+                .append("(qualifiedName=")
+                .append(qualifiedName)
+                .append(", value=")
+                .append(value)
+                .append(")");
+        return result.toString();
+    }
+
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result
+                + ((qualifiedName == null) ? 0 : qualifiedName.hashCode());
+        result = prime * result
+                + ((value == null) ? 0 : value.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (this == obj)
+        {
+            return true;
+        }
+        if (obj == null)
+        {
+            return false;
+        }
+        if (getClass() != obj.getClass())
+        {
+            return false;
+        }
+
+        final OptionImpl other = (OptionImpl) obj;
+        if (qualifiedName == null)
+        {
+            if (other.qualifiedName != null)
+            {
+                return false;
+            }
+        }
+        else if (!qualifiedName.equals(other.qualifiedName))
+        {
+            return false;
+        }
+        if (value == null)
+        {
+            if (other.value != null)
+            {
+                return false;
+            }
+        }
+        else if (!value.equals(other.value))
+        {
+            return false;
+        }
+        return true;
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/OptionName.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/OptionName.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/OptionName.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/OptionName.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,36 @@
+package org.apache.torque.gf.option;
+
+/*
+ * 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.
+ */
+
+/**
+ * An interface for a class representing the name of an option.
+ * This is useful e.g. if enums are defined for option names.
+ *
+ * $Id: $
+ */
+public interface OptionName
+{
+    /**
+     * returns the name of the source element.
+     *
+     * @return the name of the source element, not null.
+     */
+    String getName();
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/Options.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/Options.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/Options.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/Options.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,193 @@
+package org.apache.torque.gf.option;
+
+/*
+ * 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 java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.torque.gf.qname.Namespace;
+import org.apache.torque.gf.qname.QualifiedName;
+import org.apache.torque.gf.qname.QualifiedNameMap;
+
+/**
+ * A Store for all options.
+ */
+public class Options
+{
+    /** The options with global scope. */
+    private QualifiedNameMap<Option> globalScope
+            = new QualifiedNameMap<Option>();
+
+    /**
+     * Sets an option with global scope.
+     *
+     * @param option the option to set, not null.
+     *
+     * @throws NullPointerException if option is null.
+     */
+    public void setGlobalOption(Option option)
+    {
+        globalScope.put(option.getQualifiedName(), option);
+    }
+
+    /**
+     * Adds several options with global scope.
+     *
+     * @param options the option to add, not null, may not contain null.
+     *
+     * @throws NullPointerException if options is null or contains null.
+     */
+    public void addGlobalOptions(Collection<Option> options)
+    {
+        for (Option option : options)
+        {
+            setGlobalOption(option);
+        }
+    }
+
+    /**
+     * Returns the value of the option which is closest in Hierarchy.
+     * If more than one matching options (options with the matching name
+     * and in the name space or parent name space of the key) are found,
+     * the one which name space is closer to the given key's name space
+     * is chosen.
+     *
+     * @param key the key for the option which value should be retrieved.
+     *
+     * @return the value of the option (can be null), or null if no matching
+     *         option exists.
+     */
+    public Option getInHierarchy(QualifiedName key)
+    {
+        QualifiedName globalKey = globalScope.getKeyInHierarchy(key);
+        Option globalOption = globalScope.get(globalKey);
+        return globalOption;
+    }
+
+    /**
+     * Returns all mappings which live in the given name space.
+     * If one mapping hides another mapping, i.e. if one mapping
+     * is a more specialized version of another, the hidden mapping
+     * is NOT returned.
+     *
+     * @param namespace the name space from which the returned options should
+     *        be visible.
+     *
+     * @return an Options object containing the matching options
+     */
+    public Options getInHierarchy(Namespace namespace)
+    {
+        Options result = new Options();
+        result.globalScope = globalScope.getInHierarchy(namespace);
+        return result;
+    }
+
+    /**
+     * Returns all mappings which live in the given namespace.
+     * If one mapping hides another mapping, i.e. if one mapping
+     * is a more specialized version of another, both
+     * mappings are present in the returned map.
+     *
+     * @param namespace the name space from which the returned options should
+     *        be visible.
+     *
+     * @return an Options object containing the matching options
+     */
+    public Options getAllInHierarchy(Namespace namespace)
+    {
+        Options result = new Options();
+        result.globalScope = globalScope.getAllInHierarchy(namespace);
+        return result;
+    }
+
+    /**
+     * Returns all options in a Collection.
+     * If options with the same name are present in the result,
+     * options with generator scope override those with global scope.
+     *
+     * @return a Collection containing all options, not null.
+     *         The collection is unmodifiable.
+     */
+    public Collection<Option> values()
+    {
+        Map<QualifiedName, Option> result
+                = new HashMap<QualifiedName, Option>();
+        for (Option globalOption : globalScope.values())
+        {
+            result.put(globalOption.getQualifiedName(), globalOption);
+        }
+        for (Option generatorOption : globalScope.values())
+        {
+            result.put(generatorOption.getQualifiedName(), generatorOption);
+        }
+        return Collections.unmodifiableCollection(result.values());
+    }
+
+    /**
+     * Returns all options in a set.
+     *
+     * @return a Collection containing the qualified names of all options,
+     *         not null.
+     */
+    public Collection<QualifiedName> keySet()
+    {
+        Collection<Option> options = values();
+        Set<QualifiedName> result = new HashSet<QualifiedName>(options.size());
+        for (Option option : options)
+        {
+            result.add(option.getQualifiedName());
+        }
+        return result;
+    }
+
+    /**
+     * Returns a map containing all options in the global scope.
+     * The key of the map is the key of the option, the value is the
+     * option itself.
+     *
+     * @return a map containing the options in global scope, not null.
+     */
+    public Map<QualifiedName, Option> getGlobalScope()
+    {
+        return Collections.unmodifiableMap(globalScope);
+    }
+
+    /**
+     * Checks if an option with the given key exists in any scope.
+     *
+     * @param key the key to check.
+     *
+     * @return true if the key exists, false otherwise.
+     */
+    public boolean containsKey(QualifiedName key)
+    {
+        return (globalScope.containsKey(key));
+    }
+
+    @Override
+    public String toString()
+    {
+        return "global Scope: " + globalScope.toString();
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/UnsupportedOptionException.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/UnsupportedOptionException.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/UnsupportedOptionException.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/UnsupportedOptionException.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,41 @@
+package org.apache.torque.gf.option;
+
+/*
+ * 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.
+ */
+
+/**
+ * An exception which is thrown if an option is not supported
+ * or contains an unacceptable value.
+ */
+public class UnsupportedOptionException extends Exception
+{
+    /**
+     * The version used in the Serialization process.
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Constructs an UnsupportedOptionException.
+     * @param message the message for this Exception
+     */
+    public UnsupportedOptionException(String message)
+    {
+        super(message);
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/package.html
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/package.html?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/package.html (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/option/package.html Tue Feb 16 17:15:43 2010
@@ -0,0 +1,25 @@
+<!--
+ 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.
+-->
+<html>
+  <head>
+    <title>Torque-gf options</title>
+  </head>
+  <body>
+    <p>
+      This package contains classes handling options.
+    </p>
+  </body>
+</html>

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/Camelbacker.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/Camelbacker.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/Camelbacker.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/Camelbacker.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,280 @@
+package org.apache.torque.gf.processor.string;
+
+/*
+ * 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.
+ */
+
+/**
+ * Creates a String in CaMelBaCk case from a String with special characters
+ */
+public class Camelbacker implements StringProcessor
+{
+    /**
+     * Whether the first character of the processed String should always
+     * be upper case.
+     */
+    private boolean firstCharUppercase = true;
+
+    /**
+     * Separation characters. If one of the characters in this String
+     * is encountered in the processed String, the  part of the processed
+     * String before it are ignored. The character itself is retained,
+     * unless it is removed by another rule.
+     */
+    private String ignorePartBefore = null;
+
+    /**
+     * Separation characters. If one of the characters in this String
+     * is encountered in the processed String, the part of the processed
+     * String after it are ignored. The character itself is retained,
+     * unless it is removed by another rule.
+     */
+    private String ignorePartAfter = null;
+
+    /**
+     * All the characters in this String are removed from the processed String.
+     */
+    private String removeWithoutUppercase = ".";
+
+    /**
+     * All the characters in this String are removed from the processed String;
+     * the following character is converted to upper case.
+     */
+    private String removeWithUppercase = "_-";
+
+    /**
+     * Whether all characters in the processed String should be made
+     * lower Case by default (i.e if none of the camelback rules is applicable).
+     */
+    private boolean defaultLowerCase = true;
+
+    /**
+     * Does the camelback processing according to the settings.
+     */
+    public String process(String toProcess)
+    {
+        StringBuilder result = new StringBuilder();
+        boolean ignoreAfterHit = false;
+        boolean nextCharUpperCase = firstCharUppercase;
+        for (int i = 0; i < toProcess.length(); ++i)
+        {
+            char currentChar = toProcess.charAt(i);
+            if (ignorePartBefore != null
+                    && ignorePartBefore.indexOf(currentChar) != -1)
+            {
+                result = new StringBuilder();
+            }
+            if (ignoreAfterHit)
+            {
+                // we cannot do a break here, because one of the characters in
+                // ignorePartBefore may still be encountered, and then we have
+                // to clean the result
+                continue;
+            }
+            if (ignorePartAfter != null
+                    && ignorePartAfter.indexOf(currentChar) != -1)
+            {
+                ignoreAfterHit = true;
+            }
+            if (removeWithoutUppercase != null
+                    && removeWithoutUppercase.indexOf(currentChar) != -1)
+            {
+                continue;
+            }
+            if (removeWithUppercase != null
+                    && removeWithUppercase.indexOf(currentChar) != -1)
+            {
+
+                nextCharUpperCase = true;
+                continue;
+            }
+            if (nextCharUpperCase)
+            {
+                result.append(Character.toUpperCase(currentChar));
+                nextCharUpperCase = false;
+            }
+            else
+            {
+                if (defaultLowerCase)
+                {
+                    result.append(Character.toLowerCase(currentChar));
+                }
+                else
+                {
+                    result.append(currentChar);
+                }
+            }
+        }
+        return result.toString();
+    }
+
+    /**
+     * Returns whether the first character is always converted to upper case.
+     *
+     * @return true if the first character is always converted to upper case,
+     *         false if not.
+     */
+    public boolean isFirstCharUppercase()
+    {
+        return firstCharUppercase;
+    }
+
+    /**
+     * Sets whether the first character should always be upper case.
+     * Default is true.
+     *
+     * @param firstCharUppercase true if the first character should always
+     *        be converted to upper case, false if not.
+     */
+    public void setFirstCharUppercase(boolean firstCharUppercase)
+    {
+        this.firstCharUppercase = firstCharUppercase;
+    }
+
+    /**
+     * Returns the separation chars which define the tail to be removed.
+     * If one of the characters in this String
+     * is encountered in the processed String, the part of the processed
+     * String after it are ignored. The character itself is retained,
+     * unless it is removed by another rule.
+     *
+     * @return the separation chars for removing the tail.
+     */
+    public String getIgnorePartAfter()
+    {
+        return ignorePartAfter;
+    }
+
+    /**
+     * Sets the separation chars which define the suffix to be removed.
+     * If one of the characters in this String
+     * is encountered in the processed String, the part of the processed
+     * String after it are ignored. The character itself is retained,
+     * unless it is removed by another rule.
+     *
+     * @param ignorePartAfter the separation chars for removing the tail.
+     */
+    public void setIgnorePartAfter(String ignorePartAfter)
+    {
+        this.ignorePartAfter = ignorePartAfter;
+    }
+
+    /**
+     * Returns the separation characters which defile the prefix to be removed.
+     * If one of the characters in this String
+     * is encountered in the processed String, the  part of the processed
+     * String before it are ignored. The character itself is retained,
+     * unless it is removed by another rule.
+     *
+     * @return the separation chars which define the suffix to be removed.
+     */
+    public String getIgnorePartBefore()
+    {
+        return ignorePartBefore;
+    }
+
+    /**
+     * Sets the separation characters which define the prefix to be removed.
+     * If one of the characters in this String
+     * is encountered in the processed String, the  part of the processed
+     * String before it are ignored. The character itself is retained,
+     * unless it is removed by another rule.
+     *
+     * @param ignorePartBefore the separation chars which define the suffix
+     *        to be removed.
+     */
+    public void setIgnorePartBefore(String ignorePartBefore)
+    {
+        this.ignorePartBefore = ignorePartBefore;
+    }
+
+    /**
+     * Returns which characters are removed from the processed String.
+     *
+     * @return a String containing all characters which are simply removed
+     *         from the input String.
+     */
+    public String getRemoveWithoutUppercase()
+    {
+        return removeWithoutUppercase;
+    }
+
+    /**
+     * Sets which characters are removed from the processed String.
+     * Default is "."
+     *
+     * @param removeWithoutUppercase a String containing all characters
+     *        which are simply removed from the input String.
+     */
+    public void setRemoveWithoutUppercase(String removeWithoutUppercase)
+    {
+        this.removeWithoutUppercase = removeWithoutUppercase;
+    }
+
+    /**
+     * Returns the characters which are removed from the processed String
+     * and cause the following character to be converted to upper case.
+     *
+     * @return a String containing all characters which are removed
+     *         from the input String and which cause the following character
+     *         to be converted to upper case.
+     */
+    public String getRemoveWithUppercase()
+    {
+        return removeWithUppercase;
+    }
+
+    /**
+     * Sets the characters which are removed from the processed String
+     * and cause the following character to be converted to upper case.
+     * Default is "_-"
+     *
+     * @param removeWithUppercase a String containing all characters which are
+     *        removed from the input String and which cause the following
+     *        character to be converted to upper case.
+     */
+    public void setRemoveWithUppercase(String removeWithUppercase)
+    {
+        this.removeWithUppercase = removeWithUppercase;
+    }
+
+    /**
+     * Returns whether all characters in the processed String should be made
+     * lower Case by default (i.e if none of the camelback rules is applicable).
+     *
+     * @return true if all characters are converted to lower case by default,
+     *         false if not.
+     */
+    public boolean isDefaultLowerCase()
+    {
+        return defaultLowerCase;
+    }
+
+    /**
+     * Sets whether all characters in the processed String should be made
+     * lower Case by default (i.e if none of the camelback rules is applicable).
+     * Default is true.
+     *
+     * @param defaultLowerCase true if all characters are converted to lower
+     *        case by default, false if not.
+     */
+    public void setDefaultLowerCase(boolean defaultLowerCase)
+    {
+        this.defaultLowerCase = defaultLowerCase;
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/CharReplacer.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/CharReplacer.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/CharReplacer.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/CharReplacer.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,128 @@
+package org.apache.torque.gf.processor.string;
+
+/*
+ * 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.
+ */
+
+/**
+ * Replaces characters by a String.
+ */
+public class CharReplacer implements StringProcessor
+{
+    /**
+     * Characters which are not allowed in java class names
+     */
+    public static final String JAVA_CLASSNAME_SPECIAL_CHARS
+           = "-.;,\"'#+*`´~";
+
+    /**
+     * The String which is usually used as replacement for not allowed
+     * characters in java class names.
+     */
+    public static final String JAVA_CLASSNAME_REPLACEMENT
+            = "_";
+
+    /**
+     * Contains the characters which should be replaced.
+     */
+    private String toReplace = JAVA_CLASSNAME_SPECIAL_CHARS;
+
+    /**
+     * Contains the String which should be inserted instead of the replaced
+     * characters.
+     */
+    private String toReplaceWith = JAVA_CLASSNAME_REPLACEMENT;
+
+    /**
+     * Returns a String containing all the characters which should be replaced.
+     *
+     * @return the Characters which should be replaced, not null.
+     */
+    public String getToReplace()
+    {
+        return toReplace;
+    }
+
+    /**
+     * Sets the characters which should be replaced.
+     *
+     * @param toReplace a String containing all the Characters
+     *         which should be replaced, not null.
+     */
+    public void setToReplace(String toReplace)
+    {
+        if (toReplace == null)
+        {
+            throw new NullPointerException("toReplace is null");
+        }
+        this.toReplace = toReplace;
+    }
+
+    /**
+     * Returns the String which are inserted instead of the replaced
+     * characters.
+     *
+     * @return the replacement, not null.
+     */
+    public String getToReplaceWith()
+    {
+        return toReplaceWith;
+    }
+
+    /**
+     * Sets the String which are inserted instead of the replaced
+     * characters.
+     *
+     * @param toReplaceWith the replacement, not null.
+     */
+    public void setToReplaceWith(String toReplaceWith)
+    {
+        if (toReplaceWith == null)
+        {
+            throw new NullPointerException("toReplaceWith is null");
+        }
+        this.toReplaceWith = toReplaceWith;
+    }
+
+    /**
+     * Replaces all characters in <code>toProcess</code> which occur in
+     * <code>toReplace</code> with <code>toReplaceWith</code> and returns the
+     * new String
+     *
+     * @param toProcess the String in which replacement should occur, not null.
+     *
+     * @return the processed String, not null.
+     */
+    public String process(String toProcess)
+    {
+        StringBuilder result = new StringBuilder();
+        for (int i = 0; i < toProcess.length(); ++i)
+        {
+            char currentChar = toProcess.charAt(i);
+            if (toReplace.indexOf(currentChar) != -1)
+            {
+                result.append(toReplaceWith);
+            }
+            else
+            {
+                result.append(currentChar);
+            }
+        }
+        return result.toString();
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/ConstantNameCreator.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/ConstantNameCreator.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/ConstantNameCreator.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/ConstantNameCreator.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,133 @@
+package org.apache.torque.gf.processor.string;
+
+/*
+ * 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.
+ */
+
+
+
+/**
+ * Creates the name of a constant from a string. All letters in the String are
+ * capitalized, and underscores (_) are used as separators per default.
+ */
+public class ConstantNameCreator extends CharReplacer
+{
+    /**
+     * The String which is usually used as prefix in front of upper case
+     * characters in java constants.
+     */
+    public static final String UPPER_CASE_SEPPARATION_PREFIX = "_";
+
+    /**
+     * The String which is used as prefix in front of upper case
+     * characters in java constants.
+     */
+    private String upperCaseSeparationPrefix = UPPER_CASE_SEPPARATION_PREFIX;
+
+    /**
+     * Constructor.
+     */
+    public ConstantNameCreator()
+    {
+        setToReplace(JAVA_CLASSNAME_SPECIAL_CHARS + JAVA_CLASSNAME_REPLACEMENT);
+    }
+
+    /**
+     * Returns the prefix which is used as Separator when an upper
+     * case character is encountered after a lower case character.
+     *
+     * @return the separator which is inserted between a lower case character
+     *         and an upper case character.
+     */
+    public String getUpperCaseSeparationPrefix()
+    {
+        return upperCaseSeparationPrefix;
+    }
+
+    /**
+     * Sets the prefix which is used as Separator when an upper
+     * case character is encountered after a lower case character.
+     *
+     * @param upperCaseSeparationPrefix the separator which is inserted
+     *        between a lower case character and an upper case character.
+     */
+    public void setUpperCaseSeparationPrefix(String upperCaseSeparationPrefix)
+    {
+        this.upperCaseSeparationPrefix = upperCaseSeparationPrefix;
+    }
+
+    /**
+     * Replaces all characters in <code>toProcess</code> which occur in
+     * <code>toReplace</code> with <code>toReplaceWith</code>; groups of
+     * special characters are treated as one.
+     * Inserts <code>UPPER_CASE_SEPPARATION_PREFIX</code> if an upper case
+     * character follows a lower case character, and converts all charcters
+     * to upper case. Finally, the new String is returned.
+     * <br/>
+     * Example: "prOceSS-*+ing~#._Test" is converted to "PR_OCE_SS_ING_TEST"
+     *
+     * @param toProcess the String in which replacement should occur, not null.
+     *
+     * @return the processed String, not null.
+     */
+    public String process(String toProcess)
+    {
+        StringBuilder result = new StringBuilder();
+        String toReplace = getToReplace();
+        String toReplaceWith = getToReplaceWith();
+        boolean lastCharWasSpecial = true;
+        boolean lastCharWasLowerCase = false;
+        for (int i = 0; i < toProcess.length(); ++i)
+        {
+            char currentChar = toProcess.charAt(i);
+            boolean specialChar = toReplace.indexOf(currentChar) != -1;
+            if (specialChar)
+            {
+                if (lastCharWasSpecial)
+                {
+                    continue;
+                }
+                else
+                {
+                    result.append(toReplaceWith);
+                }
+                lastCharWasLowerCase = false;
+            }
+            else if (Character.isUpperCase(currentChar))
+            {
+                if (lastCharWasSpecial || !lastCharWasLowerCase)
+                {
+                    result.append(currentChar);
+                }
+                else
+                {
+                    result.append(upperCaseSeparationPrefix)
+                        .append(currentChar);
+                }
+                lastCharWasLowerCase = false;
+            }
+            else
+            {
+                result.append(Character.toUpperCase(currentChar));
+                lastCharWasLowerCase = true;
+            }
+            lastCharWasSpecial = specialChar;
+        }
+        return result.toString();
+    }
+}

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/StringProcessor.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/StringProcessor.java?rev=910600&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/StringProcessor.java (added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/gf/processor/string/StringProcessor.java Tue Feb 16 17:15:43 2010
@@ -0,0 +1,37 @@
+package org.apache.torque.gf.processor.string;
+
+/*
+ * 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.
+ */
+
+/**
+ *
+ * A processor which takes a String as input and generates a String
+ * as output.
+ */
+public interface StringProcessor
+{
+    /**
+     * Generates another String from the passed String.
+     *
+     * @param toProcess the String to process.
+     *
+     * @return the processed String.
+     */
+    String process(String toProcess);
+}



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