|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.oddjob.arooa.parsing.Location
public class Location
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.
Based on the original by Matt Foemmel.
Field Summary | |
---|---|
static Location |
UNKNOWN_LOCATION
Location to use when one is needed but no information is available |
Constructor Summary | |
---|---|
Location(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. |
Method Summary | |
---|---|
int |
getColumnNumber()
|
String |
getFileName()
|
int |
getLineNumber()
|
String |
toString()
Returns the file name, line number, a colon and a trailing space. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Location UNKNOWN_LOCATION
Constructor Detail |
---|
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(Locator loc)
loc
- Must not be null
.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.Method Detail |
---|
public String getFileName()
public int getLineNumber()
public int getColumnNumber()
public String toString()
toString
in class Object
"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.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |