net.sf.saxon.expr

Class ExpressionLocation

public class ExpressionLocation extends Object implements SaxonLocator, Serializable

Class to hold details of the location of an expression, of an error in a source file, etc.
Constructor Summary
ExpressionLocation()
Create an ExpressionLocation
ExpressionLocation(SourceLocator loc)
Create an ExpressionLocation, taking the data from a supplied JAXP SourceLocator
ExpressionLocation(LocationProvider provider, long locationId)
Create an ExpressionLocation, taking the data from a supplied locationId along with a LocationProvider to interpret its meaning
ExpressionLocation(String systemId, int lineNumber, int columnNumber)
Create an ExpressionLocation corresponding to a given module, line number, and column number
Method Summary
intgetColumnNumber()
Get the column number
intgetColumnNumber(long locationId)
intgetLineNumber()
Get the line number
intgetLineNumber(long locationId)
Get the line number corresponding to a given location Id
StringgetPublicId()
Get the Public ID
static SaxonLocatorgetSourceLocator(long locationId, LocationProvider locationProvider)
Construct an object holding location information for a validation error message
StringgetSystemId()
Get the system ID (the module URI)
StringgetSystemId(long locationId)
Get the system Id corresponding to a given location Id
static ExpressionLocationmakeFromSax(Locator loc)
Create an ExpressionLocation, taking the data from a supplied SAX Locator
voidsetColumnNumber(int columnNumber)
Set the column number
voidsetLineNumber(int lineNumber)
Set the line number
voidsetSystemId(String systemId)
Set the systemId (the module URI)
static StringtruncateURI(String uri)
Truncate a URI to its last component

Constructor Detail

ExpressionLocation

public ExpressionLocation()
Create an ExpressionLocation

ExpressionLocation

public ExpressionLocation(SourceLocator loc)
Create an ExpressionLocation, taking the data from a supplied JAXP SourceLocator

Parameters: loc the JAXP SourceLocator

ExpressionLocation

public ExpressionLocation(LocationProvider provider, long locationId)
Create an ExpressionLocation, taking the data from a supplied locationId along with a LocationProvider to interpret its meaning

Parameters: provider the LocationProvider locationId the locationId

ExpressionLocation

public ExpressionLocation(String systemId, int lineNumber, int columnNumber)
Create an ExpressionLocation corresponding to a given module, line number, and column number

Parameters: systemId the module URI lineNumber the line number columnNumber the column number

Method Detail

getColumnNumber

public int getColumnNumber()
Get the column number

Returns: the column number

getColumnNumber

public int getColumnNumber(long locationId)

getLineNumber

public int getLineNumber()
Get the line number

Returns: the line number

getLineNumber

public int getLineNumber(long locationId)
Get the line number corresponding to a given location Id

Parameters: locationId the location Id

Returns: the line number

getPublicId

public String getPublicId()
Get the Public ID

Returns: always null in this implementation

getSourceLocator

public static SaxonLocator getSourceLocator(long locationId, LocationProvider locationProvider)
Construct an object holding location information for a validation error message

Parameters: locationId The locationId as supplied with an event such as startElement or attribute locationProvider The object that understands how to interpret the locationId

Returns: a SaxonLocator containing the location information

getSystemId

public String getSystemId()
Get the system ID (the module URI)

Returns: the system ID

getSystemId

public String getSystemId(long locationId)
Get the system Id corresponding to a given location Id

Parameters: locationId the location Id

Returns: the system Id

makeFromSax

public static ExpressionLocation makeFromSax(Locator loc)
Create an ExpressionLocation, taking the data from a supplied SAX Locator

Parameters: loc the SAX Locator

setColumnNumber

public void setColumnNumber(int columnNumber)
Set the column number

Parameters: columnNumber the column number

setLineNumber

public void setLineNumber(int lineNumber)
Set the line number

Parameters: lineNumber the line number within the module

setSystemId

public void setSystemId(String systemId)
Set the systemId (the module URI)

Parameters: systemId the systemId

truncateURI

public static String truncateURI(String uri)
Truncate a URI to its last component

Parameters: uri the URI to be truncated

Returns: the last component of the supplied URI