Class QueryParserResourceProvider
The default Lucene.Net.Util.IResourceProvider implementation for the QueryParserMessages class. This class can be set in the SetResourceProvider(IResourceProvider) method and supplied with one or more System.Resources.ResourceManager instances that can override the default query parser messages (generally, they are exception messages).
Alternatively, this class may be overridden to provide either a custom FallbackResourceManager or to alter the fallback logic in either GetString(String, CultureInfo) or GetObject(String, CultureInfo). The performance of this class may be improved significantly by specifying the System.Resources.ResourceManager that a specific resource can be found in rather than attempting all of them.
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.QueryParsers.Flexible.Core.Messages
Assembly: Lucene.Net.QueryParser.dll
Syntax
public class QueryParserResourceProvider : IResourceProvider
Constructors
| Improve this Doc View SourceQueryParserResourceProvider()
Initializes a new instance of the QueryParserResourceProvider class with default values.
Declaration
public QueryParserResourceProvider()
QueryParserResourceProvider(IList<ResourceManager>)
Initializes a new instance of the QueryParserResourceProvider class with the specified
resourceManagers
. The resourceManagers
may override resources
in the FallbackResourceManager, provided they have the same names.
Note that not all of the resources are required to be provided and if the name doesn't exist it will fall back to the next System.Resources.ResourceManager that is provided and ultimately will try the FallbackResourceManager if the resource is not found.
Declaration
public QueryParserResourceProvider(IList<ResourceManager> resourceManagers)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<System.Resources.ResourceManager> | resourceManagers | One or more System.Resources.ResourceManager instances that provide
localized resources. The |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
QueryParserResourceProvider(ResourceManager[])
Initializes a new instance of the QueryParserResourceProvider class with the specified
resourceManagers
. The resourceManagers
may override resources
in the FallbackResourceManager, provided they have the same names.
Note that not all of the resources are required to be provided and if the name doesn't exist it will fall back to the next System.Resources.ResourceManager that is provided and ultimately will try the FallbackResourceManager if the resource is not found.
Declaration
public QueryParserResourceProvider(params ResourceManager[] resourceManagers)
Parameters
Type | Name | Description |
---|---|---|
System.Resources.ResourceManager[] | resourceManagers | One or more System.Resources.ResourceManager instances that provide
localized resources. The |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
Properties
| Improve this Doc View SourceFallbackResourceManager
Gets the cached System.Resources.ResourceManager instance used as the fallback by this class.
Declaration
public virtual ResourceManager FallbackResourceManager { get; }
Property Value
Type | Description |
---|---|
System.Resources.ResourceManager |
Methods
| Improve this Doc View SourceGetObject(String, CultureInfo)
Gets the value of the specified non-string resource localized for the specified culture
.
The resource is searched for
first in the System.Resources.ResourceManager instances passed in the QueryParserResourceProvider(IList<ResourceManager>)
or QueryParserResourceProvider(ResourceManager[]) constructor, in the order they are specified. If not found, the
FallbackResourceManager is used. This method may return null
if the resource with the given name is not found.
Declaration
public virtual object GetObject(string name, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.Globalization.CultureInfo | culture |
Returns
Type | Description |
---|---|
System.Object |
GetStream(String, CultureInfo)
Returns an unmanaged memory stream object from the specified resource, using the specified culture
.
The resource is searched for
first in the System.Resources.ResourceManager instances passed in the QueryParserResourceProvider(IList<ResourceManager>)
or QueryParserResourceProvider(ResourceManager[]) constructor, in the order they are specified. If not found, the
FallbackResourceManager is used. This method may return null
if the resource with the given name is not found.
Declaration
public Stream GetStream(string name, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.Globalization.CultureInfo | culture |
Returns
Type | Description |
---|---|
System.IO.Stream |
GetString(String, CultureInfo)
Returns the value of the string resource localized for the specified culture
.
The resource is searched for
first in the System.Resources.ResourceManager instances passed in the QueryParserResourceProvider(IList<ResourceManager>)
or QueryParserResourceProvider(ResourceManager[]) constructor, in the order they are specified. If not found, the
FallbackResourceManager is used. This method may return null
if the resource with the given name is not found.
Declaration
public virtual string GetString(string name, CultureInfo culture)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.Globalization.CultureInfo | culture |
Returns
Type | Description |
---|---|
System.String |