|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.velocity.runtime.resource.ResourceManager
Class to manage the text resource for the Velocity Runtime.
Field Summary | |
private static java.util.Hashtable |
globalCache
Hashtable used to store templates that have been processed. |
private static 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 static 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. |
private static java.util.ArrayList |
resourceLoaders
The List of templateLoaders that the Runtime will use to locate the InputStream source of a template. |
private static java.util.ArrayList |
sourceInitializerList
This is a list of the template input stream source initializers, basically properties for a particular template stream source. |
private static java.util.Hashtable |
sourceInitializerMap
This is a map of public name of the template stream source to it's initializer. |
Constructor Summary | |
ResourceManager()
|
Method Summary | |
private static void |
assembleResourceLoaderInitializers()
This will produce a List of Hashtables, each hashtable contains the intialization info for a particular resource loader. |
static java.lang.String |
getLoaderNameForResource(java.lang.String resourceName)
Determines is a template exists, and returns name of the loader that provides it. |
static Resource |
getResource(java.lang.String resourceName,
int resourceType)
Deprecated. Use getResource(String resourceName, int resourceType,
String encoding ) |
static Resource |
getResource(java.lang.String resourceName,
int resourceType,
java.lang.String encoding)
Gets the named resource. |
static void |
initialize()
Initialize the ResourceManager. |
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
private static java.util.Hashtable globalCache
private static java.util.ArrayList resourceLoaders
private static java.util.ArrayList sourceInitializerList
private static java.util.Hashtable sourceInitializerMap
private static boolean resourceLoaderInitializersActive
private static boolean logWhenFound
Constructor Detail |
public ResourceManager()
Method Detail |
public static void initialize() throws java.lang.Exception
private static void assembleResourceLoaderInitializers()
public static Resource getResource(java.lang.String resourceName, int resourceType, java.lang.String encoding) throws ResourceNotFoundException, ParseErrorException, java.lang.Exception
Template
to RESOURCE_TEMPLATE
).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 parsepublic static 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 static java.lang.String getLoaderNameForResource(java.lang.String resourceName)
resourceName
- Name of template or content resource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |