|
1 /* |
|
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. |
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 * |
|
5 * This code is free software; you can redistribute it and/or modify it |
|
6 * under the terms of the GNU General Public License version 2 only, as |
|
7 * published by the Free Software Foundation. Oracle designates this |
|
8 * particular file as subject to the "Classpath" exception as provided |
|
9 * by Oracle in the LICENSE file that accompanied this code. |
|
10 * |
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
|
15 * accompanied this code). |
|
16 * |
|
17 * You should have received a copy of the GNU General Public License version |
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 * |
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 * or visit www.oracle.com if you need additional information or have any |
|
23 * questions. |
|
24 */ |
|
25 |
|
26 package com.sun.tools.doclets.internal.toolkit.taglets; |
|
27 |
|
28 import com.sun.javadoc.Tag; |
|
29 |
|
30 /** |
|
31 * An abstract class that implements the {@link Taglet} interface and |
|
32 * serves as a base for JavaFX property getter and setter taglets. |
|
33 * |
|
34 * <p><b>This is NOT part of any supported API. |
|
35 * If you write code that depends on this, you do so at your own risk. |
|
36 * This code and its internal interfaces are subject to change or |
|
37 * deletion without notice.</b> |
|
38 * |
|
39 */ |
|
40 public abstract class BasePropertyTaglet extends BaseTaglet { |
|
41 |
|
42 public BasePropertyTaglet() { |
|
43 } |
|
44 |
|
45 /** |
|
46 * This method returns the text to be put in the resulting javadoc before |
|
47 * the property name. |
|
48 * |
|
49 * @param tagletWriter the taglet writer for output |
|
50 * @return the string to be put in the resulting javadoc. |
|
51 */ |
|
52 abstract String getText(TagletWriter tagletWriter); |
|
53 |
|
54 /** |
|
55 * Given the <code>Tag</code> representation of this custom |
|
56 * tag, return its string representation, which is output |
|
57 * to the generated page. |
|
58 * @param tag the <code>Tag</code> representation of this custom tag. |
|
59 * @param tagletWriter the taglet writer for output. |
|
60 * @return the TagletOutput representation of this <code>Tag</code>. |
|
61 */ |
|
62 public TagletOutput getTagletOutput(Tag tag, TagletWriter tagletWriter) { |
|
63 TagletOutput tagletOutput = tagletWriter.getOutputInstance(); |
|
64 StringBuilder output = new StringBuilder("<P>"); |
|
65 output.append(getText(tagletWriter)); |
|
66 output.append(" <CODE>"); |
|
67 output.append(tag.text()); |
|
68 output.append("</CODE>.</P>"); |
|
69 tagletOutput.setOutput(output.toString()); |
|
70 return tagletOutput; |
|
71 } |
|
72 |
|
73 /** |
|
74 * Will return false because this tag may |
|
75 * only appear in Methods. |
|
76 * @return false since this is not a method. |
|
77 */ |
|
78 public boolean inConstructor() { |
|
79 return false; |
|
80 } |
|
81 |
|
82 /** |
|
83 * Will return false because this tag may |
|
84 * only appear in Methods. |
|
85 * @return false since this is not a method. |
|
86 */ |
|
87 public boolean inOverview() { |
|
88 return false; |
|
89 } |
|
90 |
|
91 /** |
|
92 * Will return false because this tag may |
|
93 * only appear in Methods. |
|
94 * @return false since this is not a method. |
|
95 */ |
|
96 public boolean inPackage() { |
|
97 return false; |
|
98 } |
|
99 |
|
100 /** |
|
101 * Will return false because this tag may |
|
102 * only appear in Methods. |
|
103 * @return false since this is not a method. |
|
104 */ |
|
105 public boolean inType() { |
|
106 return false; |
|
107 } |
|
108 |
|
109 /** |
|
110 * Will return false because this tag is not inline. |
|
111 * @return false since this is not an inline tag. |
|
112 */ |
|
113 public boolean isInlineTag() { |
|
114 return false; |
|
115 } |
|
116 |
|
117 } |