org.apache.tools.ant
public class Location extends Object implements Serializable
| Field Summary | |
|---|---|
| static Location | UNKNOWN_LOCATION Location to use when one is needed but no information is available |
| Constructor Summary | |
|---|---|
| Location(String fileName)
Creates a location consisting of a file name but no line number or
column number.
| |
| Location(Locator loc)
Creates a location from the SAX locator using the system ID as
the filename.
| |
| Location(String fileName, int lineNumber, int columnNumber)
Creates a location consisting of a file name, line number and
column number.
| |
| Method Summary | |
|---|---|
| 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.
|
Parameters: fileName The name of the file. May be null,
in which case the location is equivalent to
UNKNOWN_LOCATION.
Parameters: loc Must not be null.
Since: Ant 1.6
Parameters: 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.
Parameters: other the object to compare to.
Returns: true if the other object contains the same information as this object.
Since: Ant 1.6.3
Returns: the column number
Since: Ant 1.7
Returns: the filename portion of the location
Since: Ant 1.6
Returns: the line number
Since: Ant 1.6
Returns: a hash code value for this location.
Since: Ant 1.6.3
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.