Package net.sf.saxon.event
Class ReceivingContentHandler.LocalLocator
- java.lang.Object
-
- net.sf.saxon.event.ReceivingContentHandler.LocalLocator
-
- All Implemented Interfaces:
SourceLocator
,Location
,Locator
- Enclosing class:
- ReceivingContentHandler
public static class ReceivingContentHandler.LocalLocator extends Object implements Location
An implementation of the SaxonLocation
interface that wraps the SAX Locator information. Note that this object is mutable and changes continually as parsing proceeds; it is therefore necessary to call itssaveLocation()
method to obtain an immutable location that still has meaning once parsing is finished.
-
-
Field Summary
Fields Modifier and Type Field Description int
levelInEntity
-
Constructor Summary
Constructors Constructor Description LocalLocator(Locator saxLocator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnNumber()
Return the character position where the current document event ends.int
getLineNumber()
Return the line number where the current document event ends.String
getPublicId()
Return the public identifier for the current document event.String
getSystemId()
Return the system identifier for the current document event.Location
saveLocation()
Get an immutable copy of this Location object.
-
-
-
Constructor Detail
-
LocalLocator
LocalLocator(Locator saxLocator)
-
-
Method Detail
-
getSystemId
public String getSystemId()
Return the system identifier for the current document event.- Specified by:
getSystemId
in interfaceLocation
- Specified by:
getSystemId
in interfaceLocator
- Specified by:
getSystemId
in interfaceSourceLocator
- Returns:
- A string containing the system identifier, or null if none is available.
-
getPublicId
public String getPublicId()
Return the public identifier for the current document event.- Specified by:
getPublicId
in interfaceLocation
- Specified by:
getPublicId
in interfaceLocator
- Specified by:
getPublicId
in interfaceSourceLocator
- Returns:
- A string containing the public identifier, or null if none is available.
-
getLineNumber
public int getLineNumber()
Return the line number where the current document event ends.- Specified by:
getLineNumber
in interfaceLocation
- Specified by:
getLineNumber
in interfaceLocator
- Specified by:
getLineNumber
in interfaceSourceLocator
- Returns:
- The line number, or -1 if none is available.
-
getColumnNumber
public int getColumnNumber()
Return the character position where the current document event ends.- Specified by:
getColumnNumber
in interfaceLocation
- Specified by:
getColumnNumber
in interfaceLocator
- Specified by:
getColumnNumber
in interfaceSourceLocator
- Returns:
- The column number, or -1 if none is available.
-
saveLocation
public Location saveLocation()
Get an immutable copy of this Location object. By default Location objects may be mutable, so they should not be saved for later use. The result of this operation holds the same location information, but in an immutable form.- Specified by:
saveLocation
in interfaceLocation
- Returns:
- an immutable copy (which may be the original object, if it is already immutable)
-
-