在JAXP中透明的缓存XSL转换器(4) throws TransformerConfigurationException { // Search the cache for the templates entry TemplatesCacheEntry templatesCacheEntry = read(file.getAbsolutePath());
// If entry is found if (templatesCacheEntry != null) { // Check timestamp of modification if (templatesCacheEntry.lastModified < templatesCacheEntry.templatesFile.lastModified()) // Clear entry, if it is obsolete templatesCacheEntry = null; } // If no templatesEntry is found or this entry was obsolete if (templatesCacheEntry == null) { logger.debug("Loading transformation [" + file.getAbsolutePath() + "]."); // If this file does not exists, throw the exception if (!file.exists()) { throw new TransformerConfigurationException( "Requested transformation [" + file.getAbsolutePath() + "] does not exist."); }
// Create new cache entry templatesCacheEntry = new TemplatesCacheEntry(newTemplates(new StreamSource(file)), file);