001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 018 019 package javax.servlet.jsp.tagext; 020 021 /** 022 * Tag information for a tag file in a Tag Library; 023 * This class is instantiated from the Tag Library Descriptor file (TLD) 024 * and is available only at translation time. 025 * 026 * @since 2.0 027 */ 028 public class TagFileInfo { 029 030 /** 031 * Constructor for TagFileInfo from data in the JSP 2.0 format for TLD. 032 * This class is to be instantiated only from the TagLibrary code 033 * under request from some JSP code that is parsing a 034 * TLD (Tag Library Descriptor). 035 * 036 * Note that, since TagLibraryInfo reflects both TLD information 037 * and taglib directive information, a TagFileInfo instance is 038 * dependent on a taglib directive. This is probably a 039 * design error, which may be fixed in the future. 040 * 041 * @param name The unique action name of this tag 042 * @param path Where to find the .tag file implementing this 043 * action, relative to the location of the TLD file. 044 * @param tagInfo The detailed information about this tag, as parsed 045 * from the directives in the tag file. 046 */ 047 public TagFileInfo( String name, String path, TagInfo tagInfo ) { 048 this.name = name; 049 this.path = path; 050 this.tagInfo = tagInfo; 051 } 052 053 /** 054 * The unique action name of this tag. 055 * 056 * @return The (short) name of the tag. 057 */ 058 public String getName() { 059 return name; 060 } 061 062 /** 063 * Where to find the .tag file implementing this action. 064 * 065 * @return The path of the tag file, relative to the TLD, or "." if 066 * the tag file was defined in an implicit tag file. 067 */ 068 public String getPath() { 069 return path; 070 } 071 072 /** 073 * Returns information about this tag, parsed from the directives 074 * in the tag file. 075 * 076 * @return a TagInfo object containing information about this tag 077 */ 078 public TagInfo getTagInfo() { 079 return tagInfo; 080 } 081 082 // private fields for 2.0 info 083 private String name; 084 private String path; 085 private TagInfo tagInfo; 086 }