C# Class Spring.Globalization.AbstractLocalizer

Abstract base class that all localizers should extend

This class contains the bulk of the localizer logic, including implementation of the ApplyResources methods that are defined in ILocalizer interface.

All specific localizers need to do is inherit this class and implement GetResources method that will return a list of Resource objects that should be applied to a specified target.

Custom implementations can use whatever type of resource storage they want, such as standard .NET resource sets, custom XML files, database, etc.

Inheritance: ILocalizer
显示文件 Open project: spring-projects/spring-net

Public Methods

Method Description
ApplyResources ( object target, IMessageSource messageSource ) : void

Applies resources to the specified target object, using current thread's uiCulture to resolve resources.

ApplyResources ( object target, IMessageSource messageSource, CultureInfo culture ) : void

Applies resources of the specified culture to the specified target object.

Protected Methods

Method Description
LoadResources ( object target, IMessageSource messageSource, CultureInfo culture ) : IList

Loads resources from the storage and creates a list of Resource instances that should be applied to the target.

Private Methods

Method Description
GetResources ( object target, IMessageSource messageSource, CultureInfo culture ) : IList

Returns a list of Resource instances that should be applied to the target.

Method Details

ApplyResources() public method

Applies resources to the specified target object, using current thread's uiCulture to resolve resources.
public ApplyResources ( object target, IMessageSource messageSource ) : void
target object Target object to apply resources to.
messageSource IMessageSource instance to retrieve resources from.
return void

ApplyResources() public method

Applies resources of the specified culture to the specified target object.
public ApplyResources ( object target, IMessageSource messageSource, CultureInfo culture ) : void
target object Target object to apply resources to.
messageSource IMessageSource instance to retrieve resources from.
culture System.Globalization.CultureInfo Resource culture to use for resource lookup.
return void

LoadResources() protected abstract method

Loads resources from the storage and creates a list of Resource instances that should be applied to the target.
protected abstract LoadResources ( object target, IMessageSource messageSource, CultureInfo culture ) : IList
target object Target to get a list of resources for.
messageSource IMessageSource instance to retrieve resources from.
culture System.Globalization.CultureInfo Resource locale.
return IList