public class Location extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static Location |
UNKNOWN_LOCATION
Location to use when one is needed but no information is available
|
| Constructor and Description |
|---|
Location(org.xml.sax.Locator loc)
Creates a location from the SAX locator using the system ID as
the filename.
|
Location(String fileName)
Creates a location consisting of a file name but no line number or
column number.
|
Location(String fileName,
int lineNumber,
int columnNumber)
Creates a location consisting of a file name, line number and
column number.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
Equality operation.
|
int |
getColumnNumber() |
String |
getFileName() |
int |
getLineNumber() |
int |
hashCode()
Hash operation.
|
String |
toString()
Returns the file name, line number, a colon and a trailing space.
|
public static final Location UNKNOWN_LOCATION
public Location(org.xml.sax.Locator loc)
loc - Must not be null.public Location(String fileName)
fileName - The name of the file. May be null,
in which case the location is equivalent to
UNKNOWN_LOCATION.public Location(String fileName, int lineNumber, int columnNumber)
fileName - The name of the file. May be null,
in which case the location is equivalent to
UNKNOWN_LOCATION.lineNumber - Line number within the file. Use 0 for unknown
positions within a file.columnNumber - Column number within the line.public boolean equals(Object other)
equals in class Objectother - the object to compare to.Object.hashCode(),
HashMappublic int getColumnNumber()
public String getFileName()
public int getLineNumber()
public int hashCode()
hashCode in class ObjectObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public String toString()