Top Description Methods
org.jdom2.located

public Interface Located

Known Direct Implementers
org.jdom2.located.LocatedCDATA, org.jdom2.located.LocatedComment, org.jdom2.located.LocatedDocType, org.jdom2.located.LocatedElement, org.jdom2.located.LocatedEntityRef, org.jdom2.located.LocatedProcessingInstruction, org.jdom2.located.LocatedText

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).

Author
Rolf Lear

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the column
getColumn
()

Get the column (character on the line).

public int

Returns:

the line number
getLine
()

Get the line number

public void
setColumn(int
The column
col
)

Set the column (character on the line).

public void
setLine(int
the line.
line
)

Set the line number

Method Detail

getColumnback to summary
public int getColumn()

Get the column (character on the line).

Returns:int

the column

getLineback to summary
public int getLine()

Get the line number

Returns:int

the line number

setColumnback to summary
public void setColumn(int col)

Set the column (character on the line).

Parameters
col:int

The column

setLineback to summary
public void setLine(int line)

Set the line number

Parameters
line:int

the line.