KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > phoenix > tools > xdoclet > ManifestSubTask


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.phoenix.tools.xdoclet;
9
10 import java.net.URL JavaDoc;
11 import xdoclet.TemplateSubTask;
12 import xdoclet.XDocletException;
13
14 /**
15  * Generates Manifest file for Blocks
16  *
17  * @author <a HREF="mailto:vinay_chandran@users.sourceforge.net">Vinay Chandrasekharan</a>
18  * @author <a HREF="mailto:peter at apache.org">Peter Donald</a>
19  * @version $Revision: 1.9.2.1 $ $Date: 2002/09/08 06:04:33 $
20  * @ant.element display-name="Manifest" name="manifest" parent="org.apache.avalon.phoenix.tools.xdoclet.PhoenixXDocletTask"
21  */

22 public class ManifestSubTask
23     extends TemplateSubTask
24 {
25     private static final String JavaDoc DEFAULT_TEMPLATE_FILE =
26         "/org/apache/avalon/phoenix/tools/xdoclet/manifest.xdt";
27     private String JavaDoc m_manifestFile;
28
29     public ManifestSubTask()
30     {
31         System.out.println( "WARNING: manifest generation has " +
32                             "never been required by Phoenix and is considered, " +
33                             "a deprecated practice." );
34         setupParams();
35     }
36
37     public void setManifestFile( final String JavaDoc manifestFile )
38     {
39         m_manifestFile = manifestFile;
40         setDestinationFile( m_manifestFile );
41     }
42
43     private void setupParams()
44     {
45         setSubTaskName( "manifest" );
46         final URL JavaDoc resource = getClass().getResource( DEFAULT_TEMPLATE_FILE );
47         setTemplateURL( resource );
48         setDestinationFile( "manifest.mf" );
49         setOfType( "org.apache.avalon.phoenix.Block" );
50         setAcceptAbstractClasses( false );
51     }
52
53     protected void engineStarted() throws XDocletException
54     {
55         System.out.println( "Generating Manifest file: " + getDestinationFile() );
56     }
57 }
58
Popular Tags