Mon, 02 May 2011 02:13:02 -0700
6492694: @deprecated tag doesn't work in package-info files.
Reviewed-by: jjg
1 /*
2 * Copyright (c) 2003, 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 package com.sun.tools.doclets.internal.toolkit.util;
26 import com.sun.javadoc.*;
29 /**
30 * A tag that holds nothing but plain text. This is useful for passing
31 * text to methods that only accept inline tags as a parameter.
32 *
33 * This code is not part of an API.
34 * It is implementation that is subject to change.
35 * Do not use it as an API
36 *
37 * @author Jamie Ho
38 * @since 1.5
39 */
40 public class TextTag implements Tag {
41 protected final String text;
42 protected final String name = "Text";
43 protected final Doc holder;
45 /**
46 * Constructor
47 */
48 public TextTag(Doc holder, String text) {
49 super();
50 this.holder = holder;
51 this.text = text;
52 }
54 /**
55 * {@inheritDoc}
56 */
57 public String name() {
58 return name;
59 }
61 /**
62 * {@inheritDoc}
63 */
64 public Doc holder() {
65 return holder;
66 }
68 /**
69 * {@inheritDoc}
70 */
71 public String kind() {
72 return name;
73 }
75 /**
76 * {@inheritDoc}
77 */
78 public String text() {
79 return text;
80 }
82 /**
83 * {@inheritDoc}
84 */
85 public String toString() {
86 return name + ":" + text;
87 }
89 /**
90 * {@inheritDoc}
91 */
92 public Tag[] inlineTags() {
93 return new Tag[] {this};
94 }
96 /**
97 * {@inheritDoc}
98 */
99 public Tag[] firstSentenceTags() {
100 return new Tag[] {this};
101 }
103 /**
104 * {@inheritDoc}
105 */
106 public SourcePosition position() {
107 return holder.position();
108 }
109 }