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