KickJava   Java API By Example, From Geeks To Geeks.

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


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 MxBean info for Blocks and other classes
16  *
17  * @author <a HREF="mailto:huw@mmlive.com">Huw Roberts</a>
18  * @ant.element display-name="MxInfo" name="mxinfo" parent="org.apache.avalon.phoenix.tools.xdoclet.PhoenixXDocletTask"
19  */

20 public class MxInfoSubTask
21     extends TemplateSubTask
22 {
23     private static final String JavaDoc DEFAULT_TEMPLATE_FILE =
24         "/org/apache/avalon/phoenix/tools/xdoclet/mxinfo.xdt";
25
26     public MxInfoSubTask()
27     {
28         setupParams();
29     }
30
31     private void setupParams()
32     {
33         setSubTaskName( "mxinfo" );
34         final URL JavaDoc resource = getClass().getResource( DEFAULT_TEMPLATE_FILE );
35         setTemplateURL( resource );
36         setDestinationFile( "{0}.mxinfo" );
37
38         // need to do this here instead of setting setHavingClassTag() because want to match on either
39
// phoenix:mx-topic or phoenix:mx-proxy.
40
setHavingClassTag( "phoenix:mx-topic" );
41     }
42
43     protected void engineStarted() throws XDocletException
44     {
45         System.out.println( "Generating MxInfo file: " + getGeneratedFileName( getCurrentClass() ) );
46     }
47 }
48
Popular Tags