View Javadoc

1   package org.apache.torque.task;
2   
3   /*
4    * Copyright 2001-2005 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License")
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  import org.apache.velocity.context.Context;
20  
21  /***
22   * An ant task for generating output by using Velocity
23   *
24   * @author <a href="mailto:mpoeschl@marmot.at">Martin Poeschl</a>
25   * @version $Id: TorqueDocumentationTask.java 239624 2005-08-24 12:18:03Z henning $
26   */
27  public class TorqueDocumentationTask extends TorqueDataModelTask
28  {
29      /*** output format for the generated docs */
30      private String outputFormat;
31  
32      /***
33       * Get the current output format.
34       *
35       * @return the current output format
36       */
37      public String getOutputFormat()
38      {
39          return outputFormat;
40      }
41  
42      /***
43       * Set the current output format.
44       *
45       * @param v output format
46       */
47      public void setOutputFormat(String v)
48      {
49          outputFormat = v;
50      }
51  
52      /***
53       * Place our target package value into the context for use in the templates.
54       *
55       * @return the context
56       * @throws Exception a generic exception
57       */
58      public Context initControlContext() throws Exception
59      {
60          super.initControlContext();
61          context.put("outputFormat", outputFormat);
62          context.put("escape", new org.apache.velocity.anakia.Escape());
63          return context;
64      }
65  }