Package org.apache.tools.ant
Class Location
java.lang.Object
org.apache.tools.ant.Location
- All Implemented Interfaces:
- Serializable
Stores the location of a piece of text within a file (file name,
 line number and column number). Note that the column number is
 currently ignored.
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final LocationLocation to use when one is needed but no information is available
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a location consisting of a file name but no line number or column number.Creates a location consisting of a file name, line number and column number.Creates a location from the SAX locator using the system ID as the filename.
- 
Method Summary
- 
Field Details- 
UNKNOWN_LOCATIONLocation to use when one is needed but no information is available
 
- 
- 
Constructor Details- 
LocationCreates a location consisting of a file name but no line number or column number.- Parameters:
- fileName- The name of the file. May be- null, in which case the location is equivalent to- UNKNOWN_LOCATION.
 
- 
LocationCreates a location from the SAX locator using the system ID as the filename.- Parameters:
- loc- Must not be- null.
- Since:
- Ant 1.6
 
- 
LocationCreates a location consisting of a file name, line number and column number.- 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.
 
 
- 
- 
Method Details- 
getFileName- Returns:
- the filename portion of the location
- Since:
- Ant 1.6
 
- 
getLineNumberpublic int getLineNumber()- Returns:
- the line number
- Since:
- Ant 1.6
 
- 
getColumnNumberpublic int getColumnNumber()- Returns:
- the column number
- Since:
- Ant 1.7
 
- 
toStringReturns 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.
- 
equals
- 
hashCode
 
-