Show / Hide Table of Contents

    Class Locator

    Provide an optional convenience implementation of ILocator.

    Inheritance
    System.Object
    Locator
    Locator2
    Implements
    ILocator
    Namespace: Sax.Helpers
    Assembly: Lucene.Net.Benchmark.dll
    Syntax
    public class Locator : object, ILocator
    Remarks

    This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. Seehttp://www.saxproject.org for further information.

    This class is available mainly for application writers, who can use it to make a persistent snapshot of a locator at any point during a document parse:

    ILocator locator;
    ILocator startloc;
    
    public void SetLocator(ILocator locator)
    {
       // note the locator
       this.locator = locator;
    }
    
    public void StartDocument()
    {
       // save the location of the start of the document
       // for future use.
       ILocator startloc = new Locator(locator);
    }

    Normally, parser writers will not use this class, since it is more efficient to provide location information only when requested, rather than constantly updating a ILocator object.

    Constructors

    | Improve this Doc View Source

    Locator()

    Zero-argument constructor.

    This will not normally be useful, since the main purpose of this class is to make a snapshot of an existing ILocator.

    Declaration
    public Locator()
    | Improve this Doc View Source

    Locator(ILocator)

    Copy constructor.

    Create a persistent copy of the current state of a locator. When the original locator changes, this copy will still keep the original values (and it can be used outside the scope of DocumentHandler methods).

    Declaration
    public Locator(ILocator locator)
    Parameters
    Type Name Description
    ILocator locator

    The locator to copy.

    Properties

    | Improve this Doc View Source

    ColumnNumber

    Gets the saved column number (1-based). Returns the column number as an integer, or -1 if none is available.

    Declaration
    public int ColumnNumber { get; set; }
    Property Value
    Type Description
    System.Int32
    See Also
    ColumnNumber
    | Improve this Doc View Source

    LineNumber

    Gets the saved line number (1-based). Returns the line number as an integer, or -1 if none is available.

    Declaration
    public int LineNumber { get; set; }
    Property Value
    Type Description
    System.Int32
    See Also
    LineNumber
    | Improve this Doc View Source

    PublicId

    Gets the public identifier as a string, or null if none is available.

    Declaration
    public string PublicId { get; set; }
    Property Value
    Type Description
    System.String
    See Also
    PublicId
    | Improve this Doc View Source

    SystemId

    Gets the system identifier as a string, or null if none is available.

    Declaration
    public string SystemId { get; set; }
    Property Value
    Type Description
    System.String
    See Also
    SystemId

    Implements

    ILocator
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)