KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openide > src > JavaDocSupport


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.openide.src;
21
22
23 /** JavaDocSupport singleton which serves as source of memory implementations
24  * of JavaDoc objects and JavaDocTags
25  * @author Petr Hrebejk
26  */

27 public class JavaDocSupport extends Object JavaDoc {
28
29     /** The class is singleton. */
30     private JavaDocSupport() {
31     }
32
33     /** Creates new instance of memory implementation of JavaDoc
34      * interface.
35      * @param text Raw text of JavaDoc comment.
36      * @return Instance of memory implementation of the JavaDoc interface.
37      */

38     public static JavaDoc createJavaDoc(String JavaDoc text) {
39         return new JavaDocMemoryImpl( text );
40     }
41
42     /** Creates new instance of memory implementation of JavaDoc.Class
43      * interface.
44      * @param text Raw text of JavaDoc comment.
45      * @return Instance of memory implementation of the JavaDoc.Class interface.
46      */

47     public static JavaDoc.Class createClassJavaDoc( String JavaDoc text ) {
48         return new JavaDocMemoryImpl.Class( text );
49     }
50
51     /** Creates new instance of memory implementation of JavaDoc.Field
52      * interface.
53      * @param text Raw text of JavaDoc comment.
54      * @return Instance of memory implementation of the JavaDoc.Field interface.
55      */

56     public static JavaDoc.Field createFieldJavaDoc( String JavaDoc text ) {
57         return new JavaDocMemoryImpl.Field( text );
58     }
59
60     /** Creates new instance of memory implementation of JavaDoc.Method
61      * interface.
62      * @param text Raw text of JavaDoc comment.
63      * @return Instance of memory implementation of the JavaDoc.Method interface.
64      */

65     public static JavaDoc.Method createMethodJavaDoc( String JavaDoc text ) {
66         return new JavaDocMemoryImpl.Method( text );
67   }
68   
69     /** Creates a new instance of memory implementation of JavaDoc interface.
70       * @param text Raw contents of the comment
71       * @return Instance of memory implementation of the JavaDoc interface.
72       */

73   public static JavaDoc createInitializerJavaDoc( String JavaDoc text ) {
74     return new JavaDocMemoryImpl( text );
75     }
76
77     /** Creates new instance of memory implementation of JavaDocTag
78      * interface.
79      * @param name Name of the tag.
80      * @param text Text of the tag.
81      * @return Instance of memory implementation of the JavaDocTag interface.
82      */

83     public static JavaDocTag createTag( String JavaDoc name, String JavaDoc text ) {
84         return new JavaDocTagMemoryImpl( name, text );
85     }
86
87     /** Creates new instance of memory implementation of JavaDocTag.See
88      * interface.
89      * @param name Name of the tag.
90      * @param text Text of the tag to parse.
91      * @return Instance of memory implementation of the JavaDocTag.See interface.
92      */

93     public static JavaDocTag.See createSeeTag( String JavaDoc name, String JavaDoc text ) {
94         return new JavaDocTagMemoryImpl.See( name, text );
95     }
96
97     /** Creates new instance of memory implementation of JavaDocTag.Param
98      * interface.
99      * @param name Name of the tag.
100      * @param text Text of the tag to parse.
101      * @return Instance of memory implementation of the JavaDocTag.Param interface.
102      */

103     public static JavaDocTag.Param createParamTag( String JavaDoc name, String JavaDoc text ) {
104         return new JavaDocTagMemoryImpl.Param( name, text );
105     }
106
107     /** Creates new instance of memory implementation of JavaDocTag.Throws
108     * interface.
109     * @param name Name of the tag.
110     * @param text Text of the tag to parse.
111     * @return Instance of memory implementation of the JavaDocTag.Throws interface.
112     */

113     public static JavaDocTag.Throws createThrowsTag( String JavaDoc name, String JavaDoc text ) {
114         return new JavaDocTagMemoryImpl.Throws( name, text );
115     }
116
117     /** Creates new instance of memory implementation of JavaDocTag.SerialField
118      * interface.
119      * @param name Name of the tag.
120      * @param text Text of the tag to parse.
121      * @return Instance of memory implementation of the JavaDocTag.SerialField interface.
122      */

123     public static JavaDocTag.SerialField createSerialFieldTag( String JavaDoc name, String JavaDoc text ) {
124         return new JavaDocTagMemoryImpl.SerialField( name, text );
125     }
126 }
127
Popular Tags