net.sf.saxon.instruct
Class LocationMap
java.lang.Objectnet.sf.saxon.instruct.LocationMap
- LocationProvider, Serializable
public class LocationMap
extends java.lang.Object
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
int | allocateLocationId(String module, int lineNumber)- Allocate a location identifier to an expression
|
int | getLineNumber(long locationId)- Get the line number corresponding to a locationId
|
String | getSystemId(long locationId)- Get the system identifier corresponding to a locationId
|
LocationMap
public LocationMap()
Create a location map
allocateLocationId
public int allocateLocationId(String module,
int lineNumber) Allocate a location identifier to an expression
module - the URI (system identifier) of the modulelineNumber - the line number of the expression within the module
- the corresponding location identifier
getLineNumber
public int getLineNumber(long locationId)
Get the line number corresponding to a locationId
- getLineNumber in interface LocationProvider
locationId - the location identifier
- the corresponding line number
getSystemId
public String getSystemId(long locationId)
Get the system identifier corresponding to a locationId
- getSystemId in interface LocationProvider
locationId - the location identifier
- the corresponding system identifier