1 /*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3 *
4 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
5 *
6 * Portions Copyright Apache Software Foundation.
7 *
8 * The contents of this file are subject to the terms of either the GNU
9 * General Public License Version 2 only ("GPL") or the Common Development
10 * and Distribution License("CDDL") (collectively, the "License"). You
11 * may not use this file except in compliance with the License. You can obtain
12 * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
13 * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
14 * language governing permissions and limitations under the License.
15 *
16 * When distributing the software, include this License Header Notice in each
17 * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
18 * Sun designates this particular file as subject to the "Classpath" exception
19 * as provided by Sun in the GPL Version 2 section of the License file that
20 * accompanied this code. If applicable, add the following below the License
21 * Header, with the fields enclosed by brackets [] replaced by your own
22 * identifying information: "Portions Copyrighted [year]
23 * [name of copyright owner]"
24 *
25 * Contributor(s):
26 *
27 * If you wish your version of this file to be governed by only the CDDL or
28 * only the GPL Version 2, indicate your decision by adding "[Contributor]
29 * elects to include this software in this distribution under the [CDDL or GPL
30 * Version 2] license." If you don't indicate a single choice of license, a
31 * recipient has the option to distribute your version of this file under
32 * either the CDDL, the GPL Version 2 or to extend the choice of license to
33 * its licensees as provided above. However, if you add GPL Version 2 code
34 * and therefore, elected the GPL Version 2 license, then the option applies
35 * only if the new code is made subject to such option by the copyright
36 * holder.
37 */
38
39 package javax.servlet.jsp.tagext;
40
41 /**
42 * Tag information for a tag file in a Tag Library;
43 * This class is instantiated from the Tag Library Descriptor file (TLD)
44 * and is available only at translation time.
45 *
46 * @since 2.0
47 */
48 public class TagFileInfo {
49
50 /**
51 * Constructor for TagFileInfo from data in the JSP 2.0 format for TLD.
52 * This class is to be instantiated only from the TagLibrary code
53 * under request from some JSP code that is parsing a
54 * TLD (Tag Library Descriptor).
55 *
56 * Note that, since TagLibibraryInfo reflects both TLD information
57 * and taglib directive information, a TagFileInfo instance is
58 * dependent on a taglib directive. This is probably a
59 * design error, which may be fixed in the future.
60 *
61 * @param name The unique action name of this tag
62 * @param path Where to find the .tag file implementing this
63 * action, relative to the location of the TLD file.
64 * @param tagInfo The detailed information about this tag, as parsed
65 * from the directives in the tag file.
66 */
67 public TagFileInfo( String name, String path, TagInfo tagInfo ) {
68 this.name = name;
69 this.path = path;
70 this.tagInfo = tagInfo;
71 }
72
73 /**
74 * The unique action name of this tag.
75 *
76 * @return The (short) name of the tag.
77 */
78 public String getName() {
79 return name;
80 }
81
82 /**
83 * Where to find the .tag file implementing this action.
84 *
85 * @return The path of the tag file, relative to the TLD, or "." if
86 * the tag file was defined in an implicit tag file.
87 */
88 public String getPath() {
89 return path;
90 }
91
92 /**
93 * Returns information about this tag, parsed from the directives
94 * in the tag file.
95 *
96 * @return a TagInfo object containing information about this tag
97 */
98 public TagInfo getTagInfo() {
99 return tagInfo;
100 }
101
102 // private fields for 2.0 info
103 private String name;
104 private String path;
105 private TagInfo tagInfo;
106 }