Package org.restlet.ext.velocity
Class RepresentationResourceLoader
- java.lang.Object
-
- org.apache.velocity.runtime.resource.loader.ResourceLoader
-
- org.restlet.ext.velocity.RepresentationResourceLoader
-
public class RepresentationResourceLoader extends org.apache.velocity.runtime.resource.loader.ResourceLoaderVelocity resource loader based on a static map of representations or on a default representation.
-
-
Field Summary
Fields Modifier and Type Field Description private RepresentationdefaultRepresentationThe default representation to load.private static java.util.Map<java.lang.String,Representation>storeThe cache of template representations.
-
Constructor Summary
Constructors Constructor Description RepresentationResourceLoader(Representation defaultRepresentation)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetLastModified(org.apache.velocity.runtime.resource.Resource resource)java.io.ReadergetResourceReader(java.lang.String source, java.lang.String encoding)static java.util.Map<java.lang.String,Representation>getStore()Returns the cache of template representations.voidinit(org.apache.velocity.util.ExtProperties configuration)booleanisSourceModified(org.apache.velocity.runtime.resource.Resource resource)
-
-
-
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:
getLastModifiedin classorg.apache.velocity.runtime.resource.loader.ResourceLoader
-
isSourceModified
public boolean isSourceModified(org.apache.velocity.runtime.resource.Resource resource)
- Specified by:
isSourceModifiedin classorg.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:
getResourceReaderin classorg.apache.velocity.runtime.resource.loader.ResourceLoader- Throws:
org.apache.velocity.exception.ResourceNotFoundException
-
init
public void init(org.apache.velocity.util.ExtProperties configuration)
- Specified by:
initin classorg.apache.velocity.runtime.resource.loader.ResourceLoader
-
-