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.tools.ant.Task;
20  import org.apache.velocity.util.StringUtils;
21  
22  /***
23   * Simple task to convert packages to paths.
24   *
25   * @author <a href="mailto:stephenh@chase3000.com">Stephen Haberman</a>
26   * @version $Id: PackageAsPathTask.java 239624 2005-08-24 12:18:03Z henning $
27   */
28  public class PackageAsPathTask extends Task
29  {
30  
31      /**</package-summary/html">The package to convert/ *//package-summary.html">em>* The package to convert. */
32      protected String pckg;
33  
34      /*** The value to store the conversion in. */
35      protected String name;
36  
37      /***
38       * Executes the package to patch converstion and stores it
39       * in the user property <code>value</code>.
40       */
41      public void execute()
42      {
43          super.getProject().setUserProperty(this.name,
44                  StringUtils.getPackageAsPath(this.pckg));
45      }
46  
47      /***
48       * @param pckg the package to convert
49       */
50      public void setPackage(String pckg)
51      {
52          this.pckg = pckg;
53      }
54  
55      /***
56       * @param name the Ant variable to store the path in
57       */
58      public void setName(String name)
59      {
60          this.name = name;
61      }
62  }