| java.lang.Object org.apache.velocity.runtime.resource.ResourceManagerImpl
Method Summary | |
public String | getLoaderNameForResource(String resourceName) Determines if a template exists, and returns name of the loader that provides it. | public synchronized Resource | getResource(String resourceName, int resourceType, String encoding) Gets the named resource. | public Resource | getResource(String resourceName, int resourceType) Gets the named resource. | public synchronized 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.
Parameters: resourceName - The name of the resource to retrieve. Parameters: resourceType - The type of resource (RESOURCE_TEMPLATE , RESOURCE_CONTENT , etc.). Parameters: encoding - The character encoding to use. | protected void | refreshResource(Resource resource, String encoding) Takes an existing resource, and 'refreshes' it. |
RESOURCE_CONTENT | final public static int RESOURCE_CONTENT(Code) | | A static content resource.
|
RESOURCE_TEMPLATE | final public static int RESOURCE_TEMPLATE(Code) | | A template resources.
|
globalCache | protected ResourceCache globalCache(Code) | | Object implementing ResourceCache to be our resource manager's Resource cache.
|
resourceLoaders | final protected List resourceLoaders(Code) | | The List of templateLoaders that the Runtime will use to locate the InputStream source of a template.
|
getLoaderNameForResource | public String getLoaderNameForResource(String resourceName)(Code) | | Determines if a template exists, and returns name of the loader that provides it. This is a slightly less hokey way to
support the Velocity.templateExists() utility method, which was broken when per-template encoding was introduced. We can
revisit this.
Parameters: resourceName - Name of template or content resource class name of loader than can provide it |
getResource | public synchronized Resource getResource(String resourceName, int resourceType, String encoding) throws ResourceNotFoundException, ParseErrorException, Exception(Code) | | Gets the named resource. Returned class type corresponds to specified type (i.e. Template to
RESOURCE_TEMPLATE ).
Parameters: resourceName - The name of the resource to retrieve. Parameters: resourceType - The type of resource (RESOURCE_TEMPLATE , RESOURCE_CONTENT , etc.). Parameters: encoding - The character encoding to use. Resource with the template parsed and ready. throws: ResourceNotFoundException - if template not found from any available source. throws: ParseErrorException - if template cannot be parsed due to syntax (or other) error. throws: Exception - if a problem in parse |
initialize | public synchronized void initialize(RuntimeServices rsvc) throws Exception(Code) | | Initialize the ResourceManager.
Parameters: rsvc - The Runtime Services object which is associated with this Resource Manager. throws: Exception - |
loadResource | protected Resource loadResource(String resourceName, int resourceType, String encoding) throws ResourceNotFoundException, ParseErrorException, Exception(Code) | | Loads a resource from the current set of resource loaders.
Parameters: resourceName - The name of the resource to retrieve. Parameters: resourceType - The type of resource (RESOURCE_TEMPLATE , RESOURCE_CONTENT , etc.). Parameters: encoding - The character encoding to use. Resource with the template parsed and ready. throws: ResourceNotFoundException - if template not found from any available source. throws: ParseErrorException - if template cannot be parsed due to syntax (or other) error. throws: Exception - if a problem in parse |
refreshResource | protected void refreshResource(Resource resource, String encoding) throws ResourceNotFoundException, ParseErrorException, Exception(Code) | | Takes an existing resource, and 'refreshes' it. This generally means that the source of the resource is checked for changes
according to some cache/check algorithm and if the resource changed, then the resource data is reloaded and re-parsed.
Parameters: resource - resource to refresh Parameters: encoding - character encoding of the resource to refresh. throws: ResourceNotFoundException - if template not found from current source for this Resource throws: ParseErrorException - if template cannot be parsed due to syntax (or other) error. throws: Exception - if a problem in parse |
|
|