TagFileProcessor (Apache Tomcat 11.0.24 API Documentation)
Description: declaration: package: org.apache.jasper.compiler, class: TagFileProcessor

# Class TagFileProcessor

java.lang.Object
org.apache.jasper.compiler.TagFileProcessor

public class TagFileProcessor extends Object
1. Processes and extracts the directive info in a tag file. 2. Compiles and loads tag files used in a JSP file.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TagFileProcessor()`
  Constructs a new TagFileProcessor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `loadTagFiles(Compiler compiler, Node.Nodes page)`
  Implements a phase of the translation that compiles (if necessary) the tag files used in a JSP files.
  `static TagInfo`
  `parseTagFileDirectives(ParserController pc, String name, String path, Jar jar, TagLibraryInfo tagLibInfo)`
  Parses the tag file, and collects information on the directives included in it.
  `void`
  `removeProtoTypeFiles(String classFileName)`
  Removed the java and class files for the tag prototype generated from the current compilation.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TagFileProcessor

    public TagFileProcessor()
    Constructs a new TagFileProcessor.

- ## Method Details

  - ### parseTagFileDirectives

    public static TagInfo parseTagFileDirectives(ParserController pc, String name, String path, Jar jar, TagLibraryInfo tagLibInfo) throws JasperException
    Parses the tag file, and collects information on the directives included in it. The method is used to obtain the info on the tag file, when the handler that it represents is referenced. The tag file is not compiled here.
    Parameters:
      `pc` - the current ParserController used in this compilation
      `name` - the tag name as specified in the TLD
      `path` - the path for the tagfile
      `jar` - the Jar resource containing the tag file
      `tagLibInfo` - the TagLibraryInfo object associated with this TagInfo
    Returns:
      a TagInfo object assembled from the directives in the tag file.
    Throws:
      `JasperException` - If an error occurs during parsing

  - ### loadTagFiles

    public void loadTagFiles(Compiler compiler, Node.Nodes page) throws JasperException
    Implements a phase of the translation that compiles (if necessary) the tag files used in a JSP files. The directives in the tag files are assumed to have been processed and encapsulated as TagFileInfo in the CustomTag nodes.
    Parameters:
      `compiler` - Compiler to use to compile tag files
      `page` - The page from to scan for tag files to compile
    Throws:
      `JasperException` - If an error occurs during the scan or compilation

  - ### removeProtoTypeFiles

    public void removeProtoTypeFiles(String classFileName)
    Removed the java and class files for the tag prototype generated from the current compilation.
    Parameters:
      `classFileName` - If non-null, remove only the class file with this name.