Class RepresentationResourceLoader


  • public class RepresentationResourceLoader
    extends org.apache.velocity.runtime.resource.loader.ResourceLoader
    Velocity resource loader based on a static map of representations or on a default representation.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Representation defaultRepresentation
      The default representation to load.
      private static java.util.Map<java.lang.String,​Representation> store
      The cache of template representations.
      • Fields inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader

        className, isCachingOn, log, modificationCheckInterval, rsvc
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getLastModified​(org.apache.velocity.runtime.resource.Resource resource)  
      java.io.Reader getResourceReader​(java.lang.String source, java.lang.String encoding)  
      static java.util.Map<java.lang.String,​Representation> getStore()
      Returns the cache of template representations.
      void init​(org.apache.velocity.util.ExtProperties configuration)  
      boolean isSourceModified​(org.apache.velocity.runtime.resource.Resource resource)  
      • Methods inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader

        buildReader, commonInit, getClassName, getModificationCheckInterval, isCachingOn, resourceExists, setCachingOn, setModificationCheckInterval
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • store

        private static final java.util.Map<java.lang.String,​Representation> store
        The cache of template representations.
      • defaultRepresentation

        private final Representation defaultRepresentation
        The default representation to load.
    • Constructor Detail

      • RepresentationResourceLoader

        public RepresentationResourceLoader​(Representation defaultRepresentation)
        Constructor.
        Parameters:
        defaultRepresentation - The default representation to use.
    • Method Detail

      • getStore

        public static java.util.Map<java.lang.String,​Representation> getStore()
        Returns the cache of template representations.
        Returns:
        The cache of template representations.
      • getLastModified

        public long getLastModified​(org.apache.velocity.runtime.resource.Resource resource)
        Specified by:
        getLastModified in class org.apache.velocity.runtime.resource.loader.ResourceLoader
      • isSourceModified

        public boolean isSourceModified​(org.apache.velocity.runtime.resource.Resource resource)
        Specified by:
        isSourceModified in class org.apache.velocity.runtime.resource.loader.ResourceLoader
      • getResourceReader

        public java.io.Reader getResourceReader​(java.lang.String source,
                                                java.lang.String encoding)
                                         throws org.apache.velocity.exception.ResourceNotFoundException
        Specified by:
        getResourceReader in class org.apache.velocity.runtime.resource.loader.ResourceLoader
        Throws:
        org.apache.velocity.exception.ResourceNotFoundException
      • init

        public void init​(org.apache.velocity.util.ExtProperties configuration)
        Specified by:
        init in class org.apache.velocity.runtime.resource.loader.ResourceLoader