KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > gulden > util > javasource > DocumentationTagged


1 /*
2  * Project: BeautyJ - Customizable Java Source Code Transformer
3  * Class: de.gulden.util.javasource.DocumentationTagged
4  * Version: 1.0
5  *
6  * Date: 2002-10-27
7  *
8  * Note: Contains auto-generated Javadoc comments created by BeautyJ.
9  *
10  * This is licensed under the GNU General Public License (GPL)
11  * and comes with NO WARRANTY. See file license.txt for details.
12  *
13  * Author: Jens Gulden
14  * Email: beautyj@jensgulden.de
15  */

16
17 package de.gulden.util.javasource;
18
19 import de.gulden.util.xml.XMLToolbox;
20 import org.w3c.dom.*;
21 import java.io.*;
22 import java.util.*;
23
24 /**
25  * Represents a Javadoc tag, like e.g. "@param".
26  *
27  * @author Jens Gulden
28  * @version 1.0
29  */

30 public class DocumentationTagged extends Documentation {
31
32     // ------------------------------------------------------------------------
33
// --- fields ---
34
// ------------------------------------------------------------------------
35
/**
36      * The my documentation declared.
37      */

38     public Vector myDocumentationDeclared;
39
40     /**
41      * The tag.
42      */

43     protected String JavaDoc tag;
44
45     /**
46      * The item.
47      */

48     protected String JavaDoc item;
49
50
51     // ------------------------------------------------------------------------
52
// --- methods ---
53
// ------------------------------------------------------------------------
54
/**
55      * Returns the tag.
56      */

57     public String JavaDoc getTag() {
58         return tag;
59     }
60
61     /**
62      * Sets the tag.
63      */

64     public void setTag(String JavaDoc tag) {
65         this.tag=tag;
66     }
67
68     /**
69      * Returns the item.
70      */

71     public String JavaDoc getItem() {
72         return item;
73     }
74
75     /**
76      * Sets the item.
77      */

78     public void setItem(String JavaDoc item) {
79         this.item=item;
80     }
81
82     /**
83      * Output this object as XML.
84      *
85      * @return The XML tag.
86      * @see #initFromXML
87      */

88     public Element buildXML(Document d) {
89         Element e=d.createElement("tag");
90         e.setAttribute("type",getTag());
91         e.appendChild(d.createTextNode(getText()));
92         return e;
93     }
94
95     /**
96      * Initialize this object from XML.
97      *
98      * @param element The XML tag.
99      * @throws IOException if an i/o error occurs
100      */

101     public void initFromXML(Element element) throws IOException {
102         String JavaDoc type=element.getAttribute("type");
103         String JavaDoc item=element.getAttribute("item");
104         String JavaDoc text=XMLToolbox.getText(element);
105         setTag(type);
106         setItem(item); // may be null
107
setText(text);
108     }
109
110 } // end DocumentationTagged
111
Popular Tags