net.sf.saxon.expr
Class ExpressionLocation
java.lang.Object
net.sf.saxon.expr.ExpressionLocation
- Locator, LocationProvider, SaxonLocator, Serializable, SourceLocator
public class ExpressionLocation
extends java.lang.Object
Class to hold details of the location of an expression, of an error in a source file, etc.
ExpressionLocation() - Create an ExpressionLocation
|
ExpressionLocation(SourceLocator loc) - Create an ExpressionLocation, taking the data from a supplied JAXP SourceLocator
|
ExpressionLocation(String systemId, int lineNumber, int columnNumber) - Create an ExpressionLocation corresponding to a given module, line number, and column number
|
ExpressionLocation(LocationProvider provider, long locationId) - Create an ExpressionLocation, taking the data from a supplied locationId along with a
LocationProvider to interpret its meaning
|
ExpressionLocation
public ExpressionLocation()
Create an ExpressionLocation
ExpressionLocation
public ExpressionLocation(SourceLocator loc)
Create an ExpressionLocation, taking the data from a supplied JAXP SourceLocator
loc
- the JAXP SourceLocator
ExpressionLocation
public ExpressionLocation(String systemId,
int lineNumber,
int columnNumber)
Create an ExpressionLocation corresponding to a given module, line number, and column number
systemId
- the module URIlineNumber
- the line numbercolumnNumber
- the column number
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
provider
- the LocationProviderlocationId
- the locationId
getColumnNumber
public int getColumnNumber()
Get the column number
getLineNumber
public int getLineNumber()
Get the line number
getLineNumber
public int getLineNumber(long locationId)
Get the line number corresponding to a given location Id
- getLineNumber in interface LocationProvider
locationId
- the location Id
getPublicId
public String getPublicId()
Get the Public ID
- 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
locationId
- The locationId as supplied with an event such as startElement or attributelocationProvider
- The object that understands how to interpret the locationId
- a SaxonLocator containing the location information
getSystemId
public String getSystemId()
Get the system ID (the module URI)
getSystemId
public String getSystemId(long locationId)
Get the system Id corresponding to a given location Id
- getSystemId in interface LocationProvider
locationId
- the location Id
setColumnNumber
public void setColumnNumber(int columnNumber)
Set the column number
columnNumber
- the column number
setLineNumber
public void setLineNumber(int lineNumber)
Set the line number
lineNumber
- the line number within the module
setSystemId
public void setSystemId(String systemId)
Set the systemId (the module URI)
truncateURI
public static String truncateURI(String uri)
Truncate a URI to its last component
uri
- the URI to be truncated
- the last component of the supplied URI