| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.velocity.runtime.resource.ResourceManagerImpl
public class ResourceManagerImpl
Class to manage the text resource for the Velocity Runtime.
| Field Summary | |
|---|---|
| protected  ResourceCache | globalCacheObject implementing ResourceCache to be our resource manager's Resource cache. | 
| protected  Log | logLogging. | 
| static int | RESOURCE_CONTENTA static content resource. | 
| static int | RESOURCE_TEMPLATEA template resources. | 
| protected  List | resourceLoadersThe List of templateLoaders that the Runtime will use to locate the InputStream source of a template. | 
| protected  RuntimeServices | rsvcThe internal RuntimeServices object. | 
| Constructor Summary | |
|---|---|
| ResourceManagerImpl() | |
| Method Summary | |
|---|---|
|  String | getLoaderNameForResource(String resourceName)Determines if a template exists, and returns name of the loader that provides it. | 
|  Resource | getResource(String resourceName,
            int resourceType)Deprecated. Use getResource(String resourceName, int resourceType, String encoding ) | 
|  Resource | getResource(String resourceName,
            int resourceType,
            String encoding)Gets the named resource. | 
|  void | initialize(RuntimeServices rsvc)Initialize the ResourceManager. | 
| protected  Resource | loadResource(String resourceName,
             int resourceType,
             String encoding)Loads a resource from the current set of resource loaders. | 
| protected  void | refreshResource(Resource resource,
                String encoding)Takes an existing resource, and 'refreshes' it. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final int RESOURCE_TEMPLATE
public static final int RESOURCE_CONTENT
protected ResourceCache globalCache
protected final List resourceLoaders
protected RuntimeServices rsvc
protected Log log
| Constructor Detail | 
|---|
public ResourceManagerImpl()
| Method Detail | 
|---|
public void initialize(RuntimeServices rsvc)
                throws Exception
initialize in interface ResourceManagerrsvc - The Runtime Services object which is associated with this Resource Manager.
Exception
public Resource getResource(String resourceName,
                            int resourceType,
                            String encoding)
                     throws ResourceNotFoundException,
                            ParseErrorException,
                            Exception
Template to 
 RESOURCE_TEMPLATE).
getResource in interface ResourceManagerresourceName - The name of the resource to retrieve.resourceType - The type of resource (RESOURCE_TEMPLATE, RESOURCE_CONTENT, etc.).encoding - The character encoding to use.
ResourceNotFoundException - if template not found from any available source.
ParseErrorException - if template cannot be parsed due to syntax (or other) error.
Exception - if a problem in parse
protected Resource loadResource(String resourceName,
                                int resourceType,
                                String encoding)
                         throws ResourceNotFoundException,
                                ParseErrorException,
                                Exception
resourceName - The name of the resource to retrieve.resourceType - The type of resource (RESOURCE_TEMPLATE, RESOURCE_CONTENT, etc.).encoding - The character encoding to use.
ResourceNotFoundException - if template not found from any available source.
ParseErrorException - if template cannot be parsed due to syntax (or other) error.
Exception - if a problem in parse
protected void refreshResource(Resource resource,
                               String encoding)
                        throws ResourceNotFoundException,
                               ParseErrorException,
                               Exception
resource - resource to refreshencoding - character encoding of the resource to refresh.
ResourceNotFoundException - if template not found from current source for this Resource
ParseErrorException - if template cannot be parsed due to syntax (or other) error.
Exception - if a problem in parse
public Resource getResource(String resourceName,
                            int resourceType)
                     throws ResourceNotFoundException,
                            ParseErrorException,
                            Exception
getResource(String resourceName, int resourceType, String encoding )
Template to 
 RESOURCE_TEMPLATE).
resourceName - The name of the resource to retrieve.resourceType - The type of resource (RESOURCE_TEMPLATE, RESOURCE_CONTENT, etc.).
ResourceNotFoundException - if template not found from any available source.
ParseErrorException - if template cannot be parsed due to syntax (or other) error.
Exception - if a problem in parsepublic String getLoaderNameForResource(String resourceName)
getLoaderNameForResource in interface ResourceManagerresourceName - Name of template or content resource
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||