KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > torque > task > PackageAsPathTask


1 package org.apache.torque.task;
2
3 /*
4  * Copyright 2001,2004 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,v 1.2 2004/02/22 06:27:41 jmcnally Exp $
27  */

28 public class PackageAsPathTask extends Task
29 {
30
31     /** The package to convert. */
32     protected String JavaDoc pckg;
33
34     /** The value to store the conversion in. */
35     protected String JavaDoc 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 JavaDoc 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 JavaDoc name)
59     {
60         this.name = name;
61     }
62 }
63
Popular Tags