KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > google > gwt > core > ext > typeinfo > HasMetaData


1 /*
2  * Copyright 2006 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations under
14  * the License.
15  */

16
17 /*
18  * IMPLEMENTATION NOTES
19  *
20  * This is a useful way to unify various forms of metadata so that clients don't
21  * have to be brittle with respect to Java language versions. For example, this
22  * mechanism exposes the tag "gwt.typeArgs" in a way that is independent of
23  * whether a doc comment was used or (in the future) a concrete instantiation of
24  * a generic type was used. The same idea could be useful for to exposing
25  * attributes as metadata.
26  */

27 package com.google.gwt.core.ext.typeinfo;
28
29 /**
30  * Manages doc comment metadata for an AST item. The structure of the metadata
31  * attempts to mirror the way in which tags and values were originally declared.
32  *
33  * <p>
34  * For example, for the following declaration
35  *
36  * <pre>
37  * /**
38  * * @myTag value1 value2
39  * * @myTag value3 value4
40  * * ...
41  * </pre>
42  *
43  * a call to <code>getMetaData("myTag")</code> would return this array of
44  * string arrays
45  *
46  * <pre>
47  *[0][0] = value1
48  *[0][1] = value2
49  *[1][0] = value3
50  *[1][1] = value4
51  * </pre>
52  *
53  * </p>
54  */

55 public interface HasMetaData {
56   /**
57    * Adds additional metadata.
58    */

59   void addMetaData(String JavaDoc tagName, String JavaDoc[] values);
60
61   /**
62    * Gets each list of metadata for the specified tag name.
63    */

64   String JavaDoc[][] getMetaData(String JavaDoc tagName);
65
66   /**
67    * Gets the name of available metadata tags.
68    */

69   String JavaDoc[] getMetaDataTags();
70 }
71
Popular Tags