Package net.sf.saxon.expr.parser
Class ExplicitLocation
java.lang.Object
net.sf.saxon.expr.parser.ExplicitLocation
- All Implemented Interfaces:
SourceLocator,Location,Locator
Class to hold details of the location of an expression, of an error in a source file, etc.
The object is immutable.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExplicitLocation(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 SourceLocator -
Method Summary
Modifier and TypeMethodDescriptionintGet the column numberintGet the line numberGet the Public IDGet the system ID (the module URI)static booleanAsk whether this is an "unknown location"static ExplicitLocationmakeFromSax(Locator loc) Create an ExpressionLocation, taking the data from a supplied SAX LocatorGet an immutable copy of this Location object.
-
Field Details
-
UNKNOWN_LOCATION
-
-
Constructor Details
-
ExplicitLocation
Create an ExpressionLocation, taking the data from a supplied JAXP SourceLocator- Parameters:
loc- the JAXP SourceLocator
-
ExplicitLocation
Create an ExpressionLocation corresponding to a given module, line number, and column number- Parameters:
systemId- the module URIlineNumber- the line number (starting at 1; -1 means unknown)columnNumber- the column number (starting at 1; -1 means unknown)
-
-
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 interfaceLocation- Specified by:
getSystemIdin interfaceLocator- Specified by:
getSystemIdin interfaceSourceLocator- Returns:
- the system ID
-
getPublicId
Get the Public ID- Specified by:
getPublicIdin interfaceLocation- 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 interfaceLocation- Specified by:
getLineNumberin interfaceLocator- Specified by:
getLineNumberin interfaceSourceLocator- Returns:
- the line number
-
getColumnNumber
public int getColumnNumber()Get the column number- Specified by:
getColumnNumberin interfaceLocation- Specified by:
getColumnNumberin interfaceLocator- Specified by:
getColumnNumberin interfaceSourceLocator- Returns:
- the column number
-
saveLocation
Get an immutable copy of this Location object. By default Location objects may be mutable, so they should not be saved for later use. The result of this operation holds the same location information, but in an immutable form.- Specified by:
saveLocationin interfaceLocation
-
isUnknown
Ask whether this is an "unknown location"
-