edu.northwestern.at.utils.xml

## Class XSLTCache

- java.lang.Object
- - edu.northwestern.at.utils.xml.XSLTCache

-     public class XSLTCache
      extends java.lang.Object

  Caches compiled stylesheets.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `(package private) static class` | `XSLTCache.MapEntry` Holds a value in the XSLT cache map.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.util.Map<java.lang.String,XSLTCache.MapEntry>` | `cache` Maps XSLT file names to MapEntry instances.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `XSLTCache()` Allowed overrides but not instantiation.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `flush(java.lang.String xsltFileName)` Flush a specific cached stylesheet from memory.
    `static void` | `flushAll()` Flush all cached stylesheets from memory, emptying the cache.
    `static javax.xml.transform.Transformer` | `newTransformer(java.lang.String xsltFileName)` Obtain a new Transformer instance for the specified XSLT file name.

    - ### Methods inherited from class java.lang.Object

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

- - ### Field Detail

    - #### cache

          protected static java.util.Map<java.lang.String,XSLTCache.MapEntry> cache

      Maps XSLT file names to MapEntry instances.

  - ### Constructor Detail

    - #### XSLTCache

          protected XSLTCache()

      Allowed overrides but not instantiation.

  - ### Method Detail

    - #### flushAll

          public static void flushAll()

      Flush all cached stylesheets from memory, emptying the cache.

    - #### flush

          public static void flush(java.lang.String xsltFileName)

      Flush a specific cached stylesheet from memory.
      Parameters:
        `xsltFileName` - File name of XSLT stylesheet to remove.

    - #### newTransformer

          public static javax.xml.transform.Transformer newTransformer(java.lang.String xsltFileName)
                                                                throws javax.xml.transform.TransformerConfigurationException

      Obtain a new Transformer instance for the specified XSLT file name.

      A new entry will be added to the cache if this is the first request for the specified file name.

      Parameters:
        `xsltFileName` - the file name of an XSLT stylesheet.
      Returns:
        A transformation context for the given stylesheet.
      Throws:
        `javax.xml.transform.TransformerConfigurationException`