db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r965199 - /db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/OptionOutlet.java
Date Sun, 18 Jul 2010 10:22:01 GMT
Author: tfischer
Date: Sun Jul 18 10:22:00 2010
New Revision: 965199

URL: http://svn.apache.org/viewvc?rev=965199&view=rev
Log:
Added an outlet that outputs the value of an option

Added:
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/OptionOutlet.java

Added: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/OptionOutlet.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/OptionOutlet.java?rev=965199&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/OptionOutlet.java
(added)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/java/OptionOutlet.java
Sun Jul 18 10:22:00 2010
@@ -0,0 +1,46 @@
+package org.apache.torque.generator.outlet.java;
+
+import org.apache.torque.generator.GeneratorException;
+import org.apache.torque.generator.control.ControllerState;
+import org.apache.torque.generator.qname.QualifiedName;
+
+/**
+ * Writes an option to the output.
+ */
+public class OptionOutlet extends OutletWithoutMergepoints
+{
+    /**
+     * The name of the option.
+     */
+    private String option;
+
+    /**
+     * Constructor.
+     * 
+     * @param name the name of the outlet.
+     */
+    public OptionOutlet(QualifiedName name)
+    {
+        super(name);
+    }
+
+    @Override
+    public String execute(ControllerState controllerState)
+            throws GeneratorException
+    {
+        return OutletUtils.getOption(
+                option,
+                controllerState,
+                OptionOutlet.class);
+    }
+
+    /**
+     * Sets the name of the option to output.
+     *
+     * @param option the name of the option.
+     */
+    public void setOption(String option)
+    {
+        this.option = option;
+    }
+}



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