1 package org.apache.torque.task;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 }