Modifier and Type | Field and Description |
---|---|
private final int | columnNumber
Column number within the file. |
private static final FileUtils | |
private final String | fileName
Name of the file. |
private final int | lineNumber
Line number within the file. |
private static final long | |
public static final Location | UNKNOWN_LOCATION
Location to use when one is needed but no information is available |
Access | Constructor and Description |
---|---|
private | |
public | Location(String
The name of the file. May be fileName)null ,
in which case the location is equivalent to
UNKNOWN_LOCATION .Creates a location consisting of a file name but no line number or column number. |
public | |
public | Location(String
The name of the file. May be fileName, int null ,
in which case the location is equivalent to
UNKNOWN_LOCATION .Line number within the file. Use 0 for unknown
positions within a file. lineNumber, int Column number within the line. columnNumber)Creates a location consisting of a file name, line number and column number. |
Modifier and Type | Method and Description |
---|---|
public boolean | Returns: true if the other object contains the same information as this object.the object to compare to. other)Overrides java. |
public int | |
public String | |
public int | |
public int | Returns: a hash code value for this location.Overrides java. |
public String | Returns: a String of the form"fileName:lineNumber: "
if both file name and line number are known,
"fileName: " if only the file name is known,
and the empty string for unknown locations.Overrides java. |
columnNumber | back to summary |
---|---|
private final int columnNumber Column number within the file. |
FILE_UTILS | back to summary |
---|---|
private static final FileUtils FILE_UTILS |
fileName | back to summary |
---|---|
private final String fileName Name of the file. |
lineNumber | back to summary |
---|---|
private final int lineNumber Line number within the file. |
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID |
UNKNOWN_LOCATION | back to summary |
---|---|
public static final Location UNKNOWN_LOCATION Location to use when one is needed but no information is available |
Location | back to summary |
---|---|
private Location() Creates an "unknown" location. |
Location | back to summary |
---|---|
public Location(String fileName) Creates a location consisting of a file name but no line number or column number.
|
Location | back to summary |
---|---|
public Location(Locator loc) Creates a location from the SAX locator using the system ID as the filename.
|
Location | back to summary |
---|---|
public Location(String fileName, int lineNumber, int columnNumber) Creates a location consisting of a file name, line number and column number.
|
equals | back to summary |
---|---|
public boolean equals(Object other) Overrides java. Equality operation. |
getColumnNumber | back to summary |
---|---|
public int getColumnNumber()
|
getFileName | back to summary |
---|---|
public String getFileName()
|
getLineNumber | back to summary |
---|---|
public int getLineNumber()
|
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Hash operation.
|
toString | back to summary |
---|---|
public String toString() Overrides java. Returns the file name, line number, a colon and a trailing space. An error message can be appended easily. For unknown locations, an empty string is returned. |