|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.velocity.runtime.resource.ResourceManagerImpl
Class to manage the text resource for the Velocity Runtime.
Field Summary | |
protected ResourceCache |
globalCache
Object implementing ResourceCache to be our resource manager's Resource cache. |
private boolean |
logWhenFound
switch to turn off log notice when a resource is found for the first time. |
static int |
RESOURCE_CONTENT
A static content resource. |
private static java.lang.String |
RESOURCE_LOADER_IDENTIFIER
token used to identify the loader internally |
static int |
RESOURCE_TEMPLATE
A template resources. |
private boolean |
resourceLoaderInitializersActive
Each loader needs a configuration object for its initialization, this flags keeps track of whether or not the configuration objects have been created for the resource loaders. |
protected java.util.ArrayList |
resourceLoaders
The List of templateLoaders that the Runtime will use to locate the InputStream source of a template. |
protected RuntimeServices |
rsvc
|
private java.util.ArrayList |
sourceInitializerList
This is a list of the template input stream source initializers, basically properties for a particular template stream source. |
private java.util.Hashtable |
sourceInitializerMap
This is a map of public name of the template stream source to it's initializer. |
Constructor Summary | |
ResourceManagerImpl()
|
Method Summary | |
private void |
assembleResourceLoaderInitializers()
This will produce a List of Hashtables, each hashtable contains the intialization info for a particular resource loader. |
java.lang.String |
getLoaderNameForResource(java.lang.String resourceName)
Determines is a template exists, and returns name of the loader that provides it. |
Resource |
getResource(java.lang.String resourceName,
int resourceType)
Deprecated. Use getResource(String resourceName, int resourceType,
String encoding ) |
Resource |
getResource(java.lang.String resourceName,
int resourceType,
java.lang.String encoding)
Gets the named resource. |
void |
initialize(RuntimeServices rs)
Initialize the ResourceManager. |
protected Resource |
loadResource(java.lang.String resourceName,
int resourceType,
java.lang.String encoding)
Loads a resource from the current set of resource loaders |
protected void |
refreshResource(Resource resource,
java.lang.String encoding)
Takes an existing resource, and 'refreshes' it. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int RESOURCE_TEMPLATE
public static final int RESOURCE_CONTENT
private static final java.lang.String RESOURCE_LOADER_IDENTIFIER
protected ResourceCache globalCache
protected java.util.ArrayList resourceLoaders
private java.util.ArrayList sourceInitializerList
private java.util.Hashtable sourceInitializerMap
private boolean resourceLoaderInitializersActive
private boolean logWhenFound
protected RuntimeServices rsvc
Constructor Detail |
public ResourceManagerImpl()
Method Detail |
public void initialize(RuntimeServices rs) throws java.lang.Exception
initialize
in interface ResourceManager
private void assembleResourceLoaderInitializers()
public Resource getResource(java.lang.String resourceName, int resourceType, java.lang.String encoding) throws ResourceNotFoundException, ParseErrorException, java.lang.Exception
Template
to RESOURCE_TEMPLATE
).getResource
in interface ResourceManager
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.java.lang.Exception
- if a problem in parseprotected Resource loadResource(java.lang.String resourceName, int resourceType, java.lang.String encoding) throws ResourceNotFoundException, ParseErrorException, java.lang.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.java.lang.Exception
- if a problem in parseprotected void refreshResource(Resource resource, java.lang.String encoding) throws ResourceNotFoundException, ParseErrorException, java.lang.Exception
resource
- resource to refreshResourceNotFoundException
- if template not found
from current source for this ResourceParseErrorException
- if template cannot be parsed due
to syntax (or other) error.java.lang.Exception
- if a problem in parsepublic Resource getResource(java.lang.String resourceName, int resourceType) throws ResourceNotFoundException, ParseErrorException, java.lang.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.java.lang.Exception
- if a problem in parsepublic java.lang.String getLoaderNameForResource(java.lang.String resourceName)
getLoaderNameForResource
in interface ResourceManager
resourceName
- Name of template or content resource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |