|
JDOM 2.0.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Located
Implementations of this class know about their location (line and column).
While it would seem intuitive that this represents the location where the content starts, in fact, if the data is populated by a SAX parser the line and column values represent the end of the SAX event.
SAX parsers may vary, but it typically means the character after the last character for Text and CDATA values, the character after EntityRef, Comment, and ProcessingInstruction data, and the character after the opening tag for Element content. For DocType content, it appears that Xerces is inconsistent in the location, with the location being set at what appears to be the start of the internal subset data (if any).
Finally, remember that the column value counts characters, and thus, if you have tab-indented values, the tab counts as a single character (regardless of how much it indents).
Method Summary | |
---|---|
int |
getColumn()
Get the column (character on the line). |
int |
getLine()
Get the line number |
void |
setColumn(int col)
Set the column (character on the line). |
void |
setLine(int line)
Set the line number |
Method Detail |
---|
int getLine()
int getColumn()
void setLine(int line)
line
- the line.void setColumn(int col)
col
- The column
|
JDOM 2.0.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |