Creates a new TldCache. @param servletContext the servlet context @param uriTldResourcePathMap the pre-scanned URI to resource path mappings @param tldResourcePathTaglibXmlMap the pre-parsed TLD data
(ServletContext servletContext, Map<String,TldResourcePath> uriTldResourcePathMap,
Map<TldResourcePath,TaglibXml> tldResourcePathTaglibXmlMap)
| 89 | * @param tldResourcePathTaglibXmlMap the pre-parsed TLD data |
| 90 | */ |
| 91 | public TldCache(ServletContext servletContext, Map<String,TldResourcePath> uriTldResourcePathMap, |
| 92 | Map<TldResourcePath,TaglibXml> tldResourcePathTaglibXmlMap) { |
| 93 | this.servletContext = servletContext; |
| 94 | this.uriTldResourcePathMap.putAll(uriTldResourcePathMap); |
| 95 | for (Entry<TldResourcePath,TaglibXml> entry : tldResourcePathTaglibXmlMap.entrySet()) { |
| 96 | TldResourcePath tldResourcePath = entry.getKey(); |
| 97 | long[] lastModified = getLastModified(tldResourcePath); |
| 98 | TaglibXmlCacheEntry cacheEntry = |
| 99 | new TaglibXmlCacheEntry(entry.getValue(), lastModified[0], lastModified[1]); |
| 100 | this.tldResourcePathTaglibXmlMap.put(tldResourcePath, cacheEntry); |
| 101 | } |
| 102 | boolean validate = |
| 103 | Boolean.parseBoolean(servletContext.getInitParameter(Constants.XML_VALIDATION_TLD_INIT_PARAM)); |
| 104 | String blockExternalString = servletContext.getInitParameter(Constants.XML_BLOCK_EXTERNAL_INIT_PARAM); |
| 105 | boolean blockExternal; |
| 106 | if (blockExternalString == null) { |
| 107 | blockExternal = true; |
| 108 | } else { |
| 109 | blockExternal = Boolean.parseBoolean(blockExternalString); |
| 110 | } |
| 111 | tldParser = new TldParser(true, validate, blockExternal); |
| 112 | } |
| 113 | |
| 114 | |
| 115 | /** |
nothing calls this directly
no test coverage detected