KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > taglets > TagOutput


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: TagOutput.java 316 2006-04-04 11:21:20Z pinheirg $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.taglets;
26
27 import java.util.Map JavaDoc;
28
29 import com.sun.javadoc.Tag;
30 import com.sun.tools.doclets.Taglet;
31
32
33 /**
34  * Creates a customized tag.
35  * @author Eduardo Studzinski Estima de Castro
36  * @author Gisele Pinheiro Souza
37  *
38  */

39 public class TagOutput extends BaseTaglet {
40
41     /**
42      * Default constructor.
43      */

44     public TagOutput(){
45         super("output");
46     }
47
48     /**
49      * Registers this Taglet.
50      * @param tagletMap the map to register this tag to.
51      */

52     @SuppressWarnings JavaDoc("unchecked")
53     public static void register(final Map JavaDoc tagletMap) {
54        TagOutput tag = new TagOutput();
55        Taglet t = (Taglet) tagletMap.get(tag.getName());
56        if (t != null) {
57            tagletMap.remove(tag.getName());
58        }
59        tagletMap.put(tag.getName(), tag);
60     }
61
62     /**
63      * Gives the <code>Tag</code> representation of this custom
64      * tag,returns its string representation.
65      * @param tag the <code>Tag</code> representation of this custom tag.
66      * @return output format of tag text
67      */

68     public String JavaDoc toString(final Tag tag) {
69         return "<DT>Output:<DD>" + tag.text();
70     }
71 }
72
Popular Tags