TldParser (Apache Tomcat 11.0.24 API Documentation)
Description: declaration: package: org.apache.tomcat.util.descriptor.tld, class: TldParser

# Class TldParser

java.lang.Object
org.apache.tomcat.util.descriptor.tld.TldParser

public class TldParser extends Object
Parses a Tag Library Descriptor.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TldParser(boolean namespaceAware, boolean validation, boolean blockExternal)`
  Creates a new TldParser with default rules.
  `TldParser(boolean namespaceAware, boolean validation, RuleSet ruleSet, boolean blockExternal)`
  Creates a new TldParser with the specified rule set.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TaglibXml`
  `parse(TldResourcePath path)`
  Parses a TLD from the given resource path.
  `void`
  `setClassLoader(ClassLoader classLoader)`
  Sets the class loader used for parsing.

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### TldParser

    public TldParser(boolean namespaceAware, boolean validation, boolean blockExternal)
    Creates a new TldParser with default rules.
    Parameters:
      `namespaceAware` - whether namespace processing is enabled
      `validation` - whether XML validation is enabled
      `blockExternal` - whether external entities should be blocked

  - ### TldParser

    public TldParser(boolean namespaceAware, boolean validation, RuleSet ruleSet, boolean blockExternal)
    Creates a new TldParser with the specified rule set.
    Parameters:
      `namespaceAware` - whether namespace processing is enabled
      `validation` - whether XML validation is enabled
      `ruleSet` - the rule set for parsing
      `blockExternal` - whether external entities should be blocked

- ## Method Details

  - ### parse

    public TaglibXml parse(TldResourcePath path) throws IOException, SAXException
    Parses a TLD from the given resource path.
    Parameters:
      `path` - the TLD resource path
    Returns:
      the parsed tag library XML
    Throws:
      `IOException` - if an I/O error occurs
      `SAXException` - if a parsing error occurs

  - ### setClassLoader

    public void setClassLoader(ClassLoader classLoader)
    Sets the class loader used for parsing.
    Parameters:
      `classLoader` - the class loader