Package net.sf.saxon.expr
Class ExpressionLocation
- java.lang.Object
-
- net.sf.saxon.expr.ExpressionLocation
-
- All Implemented Interfaces:
java.io.Serializable
,javax.xml.transform.SourceLocator
,LocationProvider
,SaxonLocator
,org.xml.sax.Locator
public class ExpressionLocation extends java.lang.Object implements SaxonLocator, java.io.Serializable
Class to hold details of the location of an expression, of an error in a source file, etc.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ExpressionLocation()
ExpressionLocation(java.lang.String systemId, int lineNumber, int columnNumber)
ExpressionLocation(javax.xml.transform.SourceLocator loc)
ExpressionLocation(LocationProvider provider, int locationId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnNumber()
int
getLineNumber()
int
getLineNumber(int locationId)
Get the line number within the document or module containing a particular locationjava.lang.String
getPublicId()
static SaxonLocator
getSourceLocator(int locationId, LocationProvider locationProvider)
Construct an object holding location information for a validation error messagejava.lang.String
getSystemId()
java.lang.String
getSystemId(int locationId)
Get the URI of the document or module containing a particular locationvoid
setColumnNumber(int columnNumber)
void
setLineNumber(int lineNumber)
void
setPublicId(java.lang.String publicId)
void
setSystemId(java.lang.String systemId)
static java.lang.String
truncateURI(java.lang.String uri)
Truncate a URI to its last component
-
-
-
Constructor Detail
-
ExpressionLocation
public ExpressionLocation()
-
ExpressionLocation
public ExpressionLocation(javax.xml.transform.SourceLocator loc)
-
ExpressionLocation
public ExpressionLocation(LocationProvider provider, int locationId)
-
ExpressionLocation
public ExpressionLocation(java.lang.String systemId, int lineNumber, int columnNumber)
-
-
Method Detail
-
getSystemId
public java.lang.String getSystemId()
- Specified by:
getSystemId
in interfaceorg.xml.sax.Locator
- Specified by:
getSystemId
in interfacejavax.xml.transform.SourceLocator
-
getPublicId
public java.lang.String getPublicId()
- Specified by:
getPublicId
in interfaceorg.xml.sax.Locator
- Specified by:
getPublicId
in interfacejavax.xml.transform.SourceLocator
-
getLineNumber
public int getLineNumber()
- Specified by:
getLineNumber
in interfaceorg.xml.sax.Locator
- Specified by:
getLineNumber
in interfacejavax.xml.transform.SourceLocator
-
getColumnNumber
public int getColumnNumber()
- Specified by:
getColumnNumber
in interfaceorg.xml.sax.Locator
- Specified by:
getColumnNumber
in interfacejavax.xml.transform.SourceLocator
-
setSystemId
public void setSystemId(java.lang.String systemId)
-
setPublicId
public void setPublicId(java.lang.String publicId)
-
setLineNumber
public void setLineNumber(int lineNumber)
-
setColumnNumber
public void setColumnNumber(int columnNumber)
-
getSystemId
public java.lang.String getSystemId(int locationId)
Description copied from interface:LocationProvider
Get the URI of the document or module containing a particular location- Specified by:
getSystemId
in interfaceLocationProvider
- Parameters:
locationId
- identifier of the location in question (as passed down the Receiver pipeline)- Returns:
- the URI of the document or module.
-
getLineNumber
public int getLineNumber(int locationId)
Description copied from interface:LocationProvider
Get the line number within the document or module containing a particular location- Specified by:
getLineNumber
in interfaceLocationProvider
- Parameters:
locationId
- identifier of the location in question (as passed down the Receiver pipeline)- Returns:
- the line number within the document or module.
-
getSourceLocator
public static SaxonLocator getSourceLocator(int 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 attributelocationProvider
- The object that understands how to interpret the locationId- Returns:
- a SaxonLocator containing the location information
-
truncateURI
public static java.lang.String truncateURI(java.lang.String uri)
Truncate a URI to its last component
-
-