C# Class NVelocity.Runtime.Resource.ResourceManagerImpl

Class to manage the text resource for the Velocity Runtime.
Inheritance: IResourceManager
Afficher le fichier Open project: rasmus-toftdahl-olesen/NVelocity

Protected Properties

Свойство Type Description
globalCache ResourceCache
resourceLoaders System.Collections.ArrayList
runtimeServices IRuntimeServices

Méthodes publiques

Méthode Description
GetLoaderNameForResource ( String resourceName ) : String

Determines is 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.

GetResource ( String resourceName, ResourceType resourceType ) : Resource

Gets the named resource. Returned class type corresponds to specified type (i.e. Template to Template). *

GetResource ( string resourceName, ResourceType resourceType, string encoding ) : Resource

Gets the named resource. Returned class type corresponds to specified type (i.e. Template to Template). *

Initialize ( IRuntimeServices rs ) : void

Initialize the ResourceManager.

ResourceManagerImpl ( ) : System

Méthodes protégées

Méthode Description
LoadResource ( String resourceName, ResourceType resourceType, String encoding ) : Resource

Loads a resource from the current set of resource loaders

RefreshResource ( Resource resource, String encoding ) : void

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. *

Private Methods

Méthode Description
AssembleResourceLoaderInitializers ( ) : void

This will produce a List of Hashtables, each hashtable contains the initialization info for a particular resource loader. This Hashtable will be passed in when initializing the the template loader.

Method Details

GetLoaderNameForResource() public méthode

Determines is 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.
public GetLoaderNameForResource ( String resourceName ) : String
resourceName String Name of template or content resource ///
Résultat String

GetResource() public méthode

Gets the named resource. Returned class type corresponds to specified type (i.e. Template to Template). *
public GetResource ( String resourceName, ResourceType resourceType ) : Resource
resourceName String The name of the resource to retrieve. ///
resourceType ResourceType The type of resource (Template, /// Content, etc.). ///
Résultat Resource

GetResource() public méthode

Gets the named resource. Returned class type corresponds to specified type (i.e. Template to Template). *
public GetResource ( string resourceName, ResourceType resourceType, string encoding ) : Resource
resourceName string The name of the resource to retrieve. ///
resourceType ResourceType The type of resource (Template, /// Content, etc.). ///
encoding string The character encoding to use. ///
Résultat Resource

Initialize() public méthode

Initialize the ResourceManager.
public Initialize ( IRuntimeServices rs ) : void
rs IRuntimeServices
Résultat void

LoadResource() protected méthode

Loads a resource from the current set of resource loaders
protected LoadResource ( String resourceName, ResourceType resourceType, String encoding ) : Resource
resourceName String The name of the resource to retrieve.
resourceType ResourceType The type of resource (Template, /// Content, etc.). ///
encoding String The character encoding to use.
Résultat Resource

RefreshResource() protected méthode

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. *
protected RefreshResource ( Resource resource, String encoding ) : void
resource Resource 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 /// ///
encoding String
Résultat void

ResourceManagerImpl() public méthode

public ResourceManagerImpl ( ) : System
Résultat System

Property Details

globalCache protected_oe property

Object implementing ResourceCache to be our resource manager's Resource cache.
protected ResourceCache globalCache
Résultat ResourceCache

resourceLoaders protected_oe property

The List of templateLoaders that the Runtime will use to locate the InputStream source of a template.
protected ArrayList,System.Collections resourceLoaders
Résultat System.Collections.ArrayList

runtimeServices protected_oe property

protected IRuntimeServices runtimeServices
Résultat IRuntimeServices