Package net.sf.saxon.instruct
Class LocationMap
java.lang.Object
net.sf.saxon.instruct.LocationMap
- All Implemented Interfaces:
Serializable
,LocationProvider
A LocationMap allocates integer codes to (systemId, lineNumber) pairs. The integer
codes are held inside an Expression object to track the location of the expression
in the source code
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
allocateLocationId
(String module, int lineNumber) Allocate a location identifier to an expressionint
getColumnNumber
(long locationId) Get the column number within the document or module containing a particular locationint
getLineNumber
(long locationId) Get the line number corresponding to a locationIdgetSystemId
(long locationId) Get the system identifier corresponding to a locationId
-
Constructor Details
-
LocationMap
public LocationMap()Create a location map
-
-
Method Details
-
allocateLocationId
Allocate a location identifier to an expression- Parameters:
module
- the URI (system identifier) of the modulelineNumber
- the line number of the expression within the module- Returns:
- the corresponding location identifier
-
getSystemId
Get the system identifier corresponding to a locationId- Specified by:
getSystemId
in interfaceLocationProvider
- Parameters:
locationId
- the location identifier- Returns:
- the corresponding system identifier
-
getLineNumber
public int getLineNumber(long locationId) Get the line number corresponding to a locationId- Specified by:
getLineNumber
in interfaceLocationProvider
- Parameters:
locationId
- the location identifier- Returns:
- the corresponding line number
-
getColumnNumber
public int getColumnNumber(long locationId) Description copied from interface:LocationProvider
Get the column number within the document or module containing a particular location- Specified by:
getColumnNumber
in interfaceLocationProvider
- Parameters:
locationId
- identifier of the location in question (as passed down the Receiver pipeline)- Returns:
- the column number within the document or module, or -1 if this is not available
-