KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derbyBuild > javadoc > DiskLayoutTaglet


1 /*
2
3    Derby - Class org.apache.derbyBuild.javadoc.DiskLayoutTaglet
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to You under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derbyBuild.javadoc;
23
24 import com.sun.tools.doclets.Taglet;
25 import com.sun.javadoc.*;
26 import java.util.Map JavaDoc;
27
28 public class DiskLayoutTaglet implements Taglet {
29     private String JavaDoc NAME = "disk_layout";
30     private String JavaDoc ROWNAME = "Disk Layout";
31     /**
32      * Returns the name of this taglet
33      * @return NAME
34      */

35     public String JavaDoc getName() {
36         return NAME;
37     }
38
39     /**
40      * disk_layout not expected to be used in field documentation.
41      * @return false
42      */

43     public boolean inField() {
44         return false;
45     }
46
47     /**
48      * disk_layout not expected to be used in constructor documentation.
49      * @return false
50      */

51     public boolean inConstructor() {
52         return false;
53     }
54
55     /**
56      * disk_layout not expected to be used in constructor documentation.
57      * @return false
58      */

59     public boolean inMethod() {
60         return false;
61     }
62
63     /**
64      * disk_layout can be used in overview documentation.
65      * @return true
66      */

67     public boolean inOverview() {
68         return true;
69     }
70
71     /**
72      * disk_layout can be used in package documentation.
73      * @return true
74      */

75     public boolean inPackage() {
76         return true;
77     }
78
79     /**
80      * disk_layout can be used in type documentation.
81      * @return true
82      */

83     public boolean inType() {
84         return true;
85     }
86
87     /**
88      * disk_layout is not an inline tag.
89      * @return false
90      */

91     public boolean isInlineTag() {
92         return false;
93     }
94
95     /**
96      * Register this Taglet.
97      * @param tagletMap
98      */

99     public static void register(Map JavaDoc tagletMap) {
100        DiskLayoutTaglet tag = new DiskLayoutTaglet();
101        Taglet t = (Taglet) tagletMap.get(tag.getName());
102        if (t != null) {
103            tagletMap.remove(tag.getName());
104        }
105        tagletMap.put(tag.getName(), tag);
106     }
107
108     /**
109      * Embed the contents of the disk_layout tag as a row
110      * in the disk format table. Close the table.
111      * @param tag The tag to embed to the disk format the table.
112      */

113     public String JavaDoc toString(Tag tag) {
114         return "<tr><td>" + ROWNAME + "</td>"
115                + "<td>" + tag.text() + "</td></tr></table>\n";
116     }
117
118     /**
119      * Embed multiple disk_layout tags as cells in the disk format table.
120      * Close the table.
121      * @param tags An array of tags to add to the disk format table.
122      */

123     public String JavaDoc toString(Tag[] tags) {
124         if (tags.length == 0) {
125             return null;
126         }
127         String JavaDoc result = "<tr><td>" + ROWNAME + "</td><td>" ;
128         for (int i = 0; i < tags.length; i++) {
129             if (i > 0) {
130                 result += "";
131             }
132             result += tags[i].text() + "</td></tr>";
133         }
134         return result + "</table></dt>\n";
135     }
136 }
137
138
Popular Tags