Package net.sf.saxon.expr.instruct
Class LocationMap
- java.lang.Object
-
- net.sf.saxon.expr.instruct.LocationMap
-
- All Implemented Interfaces:
java.io.Serializable,LocationProvider
public class LocationMap extends java.lang.Object implements LocationProvider, java.io.Serializable
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LocationMap()Create a location map
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intallocateLocationId(java.lang.String module, int lineNumber)Allocate a location identifier to an expressionintgetColumnNumber(long locationId)Get the column number within the document, entity, or module containing a particular locationintgetLineNumber(long locationId)Get the line number corresponding to a locationIdjava.lang.StringgetSystemId(long locationId)Get the system identifier corresponding to a locationId
-
-
-
Method Detail
-
allocateLocationId
public int allocateLocationId(java.lang.String module, int lineNumber)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
public java.lang.String getSystemId(long locationId)
Get the system identifier corresponding to a locationId- Specified by:
getSystemIdin 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:
getLineNumberin interfaceLocationProvider- Parameters:
locationId- the location identifier- Returns:
- the corresponding line number
-
getColumnNumber
public int getColumnNumber(long locationId)
Description copied from interface:LocationProviderGet the column number within the document, entity, or module containing a particular location- Specified by:
getColumnNumberin interfaceLocationProvider- Parameters:
locationId- identifier of the location in question (as passed down the Receiver pipeline)- Returns:
- the column number within the document, entity, or module, or -1 if this is not available
-
-