View Javadoc

    1   /**
    2    *
    3    * Copyright 2003-2004 The Apache Software Foundation
    4    *
    5    *  Licensed under the Apache License, Version 2.0 (the "License");
    6    *  you may not use this file except in compliance with the License.
    7    *  You may obtain a copy of the License at
    8    *
    9    *     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  //
    19  // This source code implements specifications defined by the Java
    20  // Community Process. In order to remain compliant with the specification
    21  // DO NOT add / change / or delete method signatures!
    22  //
    23
    24  package javax.servlet.jsp.tagext;
    25
    26  /**
    27   * Tag information for a tag file in a Tag Library;
    28   * This class is instantiated from the Tag Library Descriptor file (TLD)
    29   * and is available only at translation time.
    30   *
    31   * @since 2.0
    32   */
    33  public class TagFileInfo {
    34
    35      /**
    36       * Constructor for TagFileInfo from data in the JSP 2.0 format for TLD.
    37       * This class is to be instantiated only from the TagLibrary code
    38       * under request from some JSP code that is parsing a
    39       * TLD (Tag Library Descriptor).
    40       *
    41       * Note that, since TagLibibraryInfo reflects both TLD information
    42       * and taglib directive information, a TagFileInfo instance is
    43       * dependent on a taglib directive.  This is probably a
    44       * design error, which may be fixed in the future.
    45       *
    46       * @param name The unique action name of this tag
    47       * @param path Where to find the .tag file implementing this
    48       *     action, relative to the location of the TLD file.
    49       * @param tagInfo The detailed information about this tag, as parsed
    50       *     from the directives in the tag file.
    51       */
    52      public TagFileInfo( String name, String path, TagInfo tagInfo ) {
    53          this.name = name;
    54          this.path = path;
    55          this.tagInfo = tagInfo;
    56      }
    57
    58      /**
    59       * The unique action name of this tag.
    60       *
    61       * @return The (short) name of the tag.
    62       */
    63      public String getName() {
    64          return name;
    65      }
    66
    67      /**
    68       * Where to find the .tag file implementing this action.
    69       *
    70       * @return The path of the tag file, relative to the TLD, or "." if
    71       *     the tag file was defined in an implicit tag file.
    72       */
    73      public String getPath() {
    74          return path;
    75      }
    76
    77      /**
    78       * Returns information about this tag, parsed from the directives
    79       * in the tag file.
    80       *
    81       * @return a TagInfo object containing information about this tag
    82       */
    83      public TagInfo getTagInfo() {
    84          return tagInfo;
    85      }
    86
    87      // private fields for 2.0 info
    88      private String name;
    89      private String path;
    90      private TagInfo tagInfo;
    91  }