01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package javax.servlet.jsp.tagext;
19:
20: /**
21: * Tag information for a tag file in a Tag Library;
22: * This class is instantiated from the Tag Library Descriptor file (TLD)
23: * and is available only at translation time.
24: *
25: * @since 2.0
26: */
27: public class TagFileInfo {
28:
29: /**
30: * Constructor for TagFileInfo from data in the JSP 2.0 format for TLD.
31: * This class is to be instantiated only from the TagLibrary code
32: * under request from some JSP code that is parsing a
33: * TLD (Tag Library Descriptor).
34: *
35: * Note that, since TagLibraryInfo reflects both TLD information
36: * and taglib directive information, a TagFileInfo instance is
37: * dependent on a taglib directive. This is probably a
38: * design error, which may be fixed in the future.
39: *
40: * @param name The unique action name of this tag
41: * @param path Where to find the .tag file implementing this
42: * action, relative to the location of the TLD file.
43: * @param tagInfo The detailed information about this tag, as parsed
44: * from the directives in the tag file.
45: */
46: public TagFileInfo(String name, String path, TagInfo tagInfo) {
47: this .name = name;
48: this .path = path;
49: this .tagInfo = tagInfo;
50: }
51:
52: /**
53: * The unique action name of this tag.
54: *
55: * @return The (short) name of the tag.
56: */
57: public String getName() {
58: return name;
59: }
60:
61: /**
62: * Where to find the .tag file implementing this action.
63: *
64: * @return The path of the tag file, relative to the TLD, or "." if
65: * the tag file was defined in an implicit tag file.
66: */
67: public String getPath() {
68: return path;
69: }
70:
71: /**
72: * Returns information about this tag, parsed from the directives
73: * in the tag file.
74: *
75: * @return a TagInfo object containing information about this tag
76: */
77: public TagInfo getTagInfo() {
78: return tagInfo;
79: }
80:
81: // private fields for 2.0 info
82: private String name;
83: private String path;
84: private TagInfo tagInfo;
85: }
|