Fork me on GitHub
  • API

    Show / Hide Table of Contents

    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
    System.Object
    QueryParserResourceProvider
    Implements
    Lucene.Net.Util.IResourceProvider
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Lucene.Net.QueryParsers.Flexible.Core.Messages
    Assembly: Lucene.Net.QueryParser.dll
    Syntax
    public class QueryParserResourceProvider : IResourceProvider

    Constructors

    | Improve this Doc View Source

    QueryParserResourceProvider()

    Initializes a new instance of the QueryParserResourceProvider class with default values.

    Declaration
    public QueryParserResourceProvider()
    | Improve this Doc View Source

    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 resourceManagers are used in the order they are specified, and the first one that provides a non-null value for a given resource name wins.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If resourceManagers is null.

    | Improve this Doc View Source

    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 resourceManagers are used in the order they are specified, and the first one that provides a non-null value for a given resource name wins.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If resourceManagers is null.

    Properties

    | Improve this Doc View Source

    FallbackResourceManager

    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 Source

    GetObject(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
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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

    Implements

    Lucene.Net.Util.IResourceProvider
    • Improve this Doc
    • View Source
    Back to top Copyright © 2021 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.