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