C# Class Lucene.Net.QueryParsers.Flexible.Messages.NLS

MessageBundles classes extend this class, to implement a bundle. For Native Language Support (NLS), system of software internationalization. This interface is similar to the NLS class in eclipse.osgi.util.NLS class - initializeMessages() method resets the values of all static strings, should only be called by classes that extend from NLS (see TestMessages.java for reference) - performs validation of all message in a bundle, at class load time - performs per message validation at runtime - see NLSTest.java for usage reference MessageBundle classes may subclass this type.
Show file Open project: apache/lucenenet Class Usage Examples

Public Methods

Method Description
GetLocalizedMessage ( string key ) : string
GetLocalizedMessage ( string key, CultureInfo locale ) : string
GetResourceManagerFactory ( ) : IResourceManagerFactory

Gets the static IResourceManagerFactory instance responsible for creating ResourceManager instances in this class. LUCENENET specific.

SetResourceManagerFactory ( IResourceManagerFactory resourceManagerFactory ) : void

Sets the IResourceManagerFactory used to create instances of ResourceManager for retrieving localized resources. Defaults to BundleResourceManagerFactory if not set. LUCENENET specific.

Protected Methods

Method Description
InitializeMessages ( string bundleName, Type clazz ) : void

Initialize a given class with the message bundle Keys Should be called from a class that extends NLS in a static block at class load time.

NLS ( ) : Lucene.Net.Support

Private Methods

Method Description
GetResourceBundleObject ( string messageKey, CultureInfo locale ) : object
Load ( Type clazz ) : void
LoadFieldValue ( FieldInfo field, Type clazz ) : void
ValidateMessage ( string key, Type clazz ) : void

Method Details

GetLocalizedMessage() public static method

public static GetLocalizedMessage ( string key ) : string
key string
return string

GetLocalizedMessage() public static method

public static GetLocalizedMessage ( string key, CultureInfo locale ) : string
key string
locale System.Globalization.CultureInfo
return string

GetResourceManagerFactory() public static method

Gets the static IResourceManagerFactory instance responsible for creating ResourceManager instances in this class. LUCENENET specific.
public static GetResourceManagerFactory ( ) : IResourceManagerFactory
return IResourceManagerFactory

InitializeMessages() protected static method

Initialize a given class with the message bundle Keys Should be called from a class that extends NLS in a static block at class load time.
protected static InitializeMessages ( string bundleName, Type clazz ) : void
bundleName string Property file with that contains the message bundle
clazz System.Type where constants will reside
return void

NLS() protected method

protected NLS ( ) : Lucene.Net.Support
return Lucene.Net.Support

SetResourceManagerFactory() public static method

Sets the IResourceManagerFactory used to create instances of ResourceManager for retrieving localized resources. Defaults to BundleResourceManagerFactory if not set. LUCENENET specific.
public static SetResourceManagerFactory ( IResourceManagerFactory resourceManagerFactory ) : void
resourceManagerFactory IResourceManagerFactory The instance. Cannot be null.
return void