Package org.apache.jasper.servlet
Class TldScanner
- java.lang.Object
- 
- org.apache.jasper.servlet.TldScanner
 
- 
- Direct Known Subclasses:
- TldPreScanned
 
 public class TldScanner extends java.lang.ObjectScans for and loads Tag Library Descriptors contained in a web application.
- 
- 
Constructor SummaryConstructors Constructor Description TldScanner(ServletContext context, boolean namespaceAware, boolean validation, boolean blockExternal)Initialise with the application's ServletContext.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>getListeners()Returns a list of all listeners declared by scanned TLDs.java.util.Map<TldResourcePath,TaglibXml>getTldResourcePathTaglibXmlMap()Returns the map of TldResourcePath to parsed XML files built by this scanner.java.util.Map<java.lang.String,TldResourcePath>getUriTldResourcePathMap()Returns the map of URI to TldResourcePath built by this scanner.protected voidparseTld(java.lang.String resourcePath)protected voidparseTld(TldResourcePath path)voidscan()Scan for TLDs in all places defined by the specification: Tag libraries defined by the platform Entries from <jsp-config> in web.xml A resources under /WEB-INF In jar files from /WEB-INF/lib Additional entries from the containervoidscanJars()Scan for TLDs in JARs in /WEB-INF/lib.protected voidscanJspConfig()Scan for TLDs defined in <jsp-config>.protected voidscanPlatform()Scan for TLDs required by the platform specification.protected voidscanResourcePaths(java.lang.String startPath)Scan web application resources for TLDs, recursively.voidsetClassLoader(java.lang.ClassLoader classLoader)Set the class loader used by the digester to create objects as a result of this scan.
 
- 
- 
- 
Constructor Detail- 
TldScannerpublic TldScanner(ServletContext context, boolean namespaceAware, boolean validation, boolean blockExternal) Initialise with the application's ServletContext.- Parameters:
- context- the application's servletContext
- namespaceAware- should the XML parser used to parse TLD files be configured to be name space aware
- validation- should the XML parser used to parse TLD files be configured to use validation
- blockExternal- should the XML parser used to parse TLD files be configured to be block references to external entities
 
 
- 
 - 
Method Detail- 
scanpublic void scan() throws java.io.IOException, org.xml.sax.SAXExceptionScan for TLDs in all places defined by the specification:- Tag libraries defined by the platform
- Entries from <jsp-config> in web.xml
- A resources under /WEB-INF
- In jar files from /WEB-INF/lib
- Additional entries from the container
 - Throws:
- java.io.IOException- if there was a problem scanning for or loading a TLD
- org.xml.sax.SAXException- if there was a problem parsing a TLD
 
 - 
getUriTldResourcePathMappublic java.util.Map<java.lang.String,TldResourcePath> getUriTldResourcePathMap() Returns the map of URI to TldResourcePath built by this scanner.- Returns:
- the map of URI to TldResourcePath
 
 - 
getTldResourcePathTaglibXmlMappublic java.util.Map<TldResourcePath,TaglibXml> getTldResourcePathTaglibXmlMap() Returns the map of TldResourcePath to parsed XML files built by this scanner.- Returns:
- the map of TldResourcePath to parsed XML files
 
 - 
getListenerspublic java.util.List<java.lang.String> getListeners() Returns a list of all listeners declared by scanned TLDs.- Returns:
- a list of listener class names
 
 - 
setClassLoaderpublic void setClassLoader(java.lang.ClassLoader classLoader) Set the class loader used by the digester to create objects as a result of this scan. Normally this only needs to be set when using JspC.- Parameters:
- classLoader- Class loader to use when creating new objects while parsing TLDs
 
 - 
scanPlatformprotected void scanPlatform() Scan for TLDs required by the platform specification.
 - 
scanJspConfigprotected void scanJspConfig() throws java.io.IOException, org.xml.sax.SAXExceptionScan for TLDs defined in <jsp-config>.- Throws:
- java.io.IOException- Error reading resources
- org.xml.sax.SAXException- XML parsing error
 
 - 
scanResourcePathsprotected void scanResourcePaths(java.lang.String startPath) throws java.io.IOException, org.xml.sax.SAXExceptionScan web application resources for TLDs, recursively.- Parameters:
- startPath- the directory resource to scan
- Throws:
- java.io.IOException- if there was a problem scanning for or loading a TLD
- org.xml.sax.SAXException- if there was a problem parsing a TLD
 
 - 
scanJarspublic void scanJars() Scan for TLDs in JARs in /WEB-INF/lib.
 - 
parseTldprotected void parseTld(java.lang.String resourcePath) throws java.io.IOException, org.xml.sax.SAXException- Throws:
- java.io.IOException
- org.xml.sax.SAXException
 
 - 
parseTldprotected void parseTld(TldResourcePath path) throws java.io.IOException, org.xml.sax.SAXException - Throws:
- java.io.IOException
- org.xml.sax.SAXException
 
 
- 
 
-