Package net.sf.saxon.expr.parser
Class ExpressionLocation
java.lang.Object
net.sf.saxon.expr.parser.ExpressionLocation
- All Implemented Interfaces:
Serializable,SourceLocator,LocationProvider,SaxonLocator,Locator
Class to hold details of the location of an expression, of an error in a source file, etc.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an ExpressionLocationExpressionLocation(String systemId, int lineNumber, int columnNumber) Create an ExpressionLocation corresponding to a given module, line number, and column numberCreate an ExpressionLocation, taking the data from a supplied JAXP SourceLocatorExpressionLocation(LocationProvider provider, long locationId) Create an ExpressionLocation, taking the data from a supplied locationId along with a LocationProvider to interpret its meaning -
Method Summary
Modifier and TypeMethodDescriptionintGet the column numberintgetColumnNumber(long locationId) Get the column number within the document, entity, or module containing a particular locationintGet the line numberintgetLineNumber(long locationId) Get the line number corresponding to a given location IdGet the Public IDstatic SaxonLocatorgetSourceLocator(long locationId, LocationProvider locationProvider) Construct an object holding location information for a validation error messageGet the system ID (the module URI)getSystemId(long locationId) Get the system Id corresponding to a given location Idstatic ExpressionLocationmakeFromSax(Locator loc) Create an ExpressionLocation, taking the data from a supplied SAX LocatorvoidsetColumnNumber(int columnNumber) Set the column numbervoidsetLineNumber(int lineNumber) Set the line numbervoidsetSystemId(String systemId) Set the systemId (the module URI)
-
Constructor Details
-
ExpressionLocation
public ExpressionLocation()Create an ExpressionLocation -
ExpressionLocation
Create an ExpressionLocation, taking the data from a supplied JAXP SourceLocator- Parameters:
loc- the JAXP SourceLocator
-
ExpressionLocation
Create an ExpressionLocation, taking the data from a supplied locationId along with a LocationProvider to interpret its meaning- Parameters:
provider- the LocationProviderlocationId- the locationId
-
ExpressionLocation
Create an ExpressionLocation corresponding to a given module, line number, and column number- Parameters:
systemId- the module URIlineNumber- the line numbercolumnNumber- the column number
-
-
Method Details
-
makeFromSax
Create an ExpressionLocation, taking the data from a supplied SAX Locator- Parameters:
loc- the SAX Locator
-
getSystemId
Get the system ID (the module URI)- Specified by:
getSystemIdin interfaceLocator- Specified by:
getSystemIdin interfaceSourceLocator- Returns:
- the system ID
-
getPublicId
Get the Public ID- Specified by:
getPublicIdin interfaceLocator- Specified by:
getPublicIdin interfaceSourceLocator- Returns:
- always null in this implementation
-
getLineNumber
public int getLineNumber()Get the line number- Specified by:
getLineNumberin interfaceLocator- Specified by:
getLineNumberin interfaceSourceLocator- Returns:
- the line number
-
getColumnNumber
public int getColumnNumber()Get the column number- Specified by:
getColumnNumberin interfaceLocator- Specified by:
getColumnNumberin interfaceSourceLocator- Returns:
- the column number
-
setSystemId
Set the systemId (the module URI)- Parameters:
systemId- the systemId
-
setLineNumber
public void setLineNumber(int lineNumber) Set the line number- Parameters:
lineNumber- the line number within the module
-
setColumnNumber
public void setColumnNumber(int columnNumber) Set the column number- Parameters:
columnNumber- the column number
-
getSystemId
Get the system Id corresponding to a given location Id- Specified by:
getSystemIdin interfaceLocationProvider- Parameters:
locationId- the location Id- Returns:
- the system Id
-
getLineNumber
public int getLineNumber(long locationId) Get the line number corresponding to a given location Id- Specified by:
getLineNumberin interfaceLocationProvider- Parameters:
locationId- the location Id- Returns:
- the 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
-
getSourceLocator
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
-