public class Location extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Location.NodeFoundException
This is just a marker that the node has been found
|
static class |
Location.ReusableXMLSource |
Constructor and Description |
---|
Location(Document document,
Node node) |
Location(Element e) |
Location(Token token) |
Location(XMLSource source,
int offset) |
Modifier and Type | Method and Description |
---|---|
protected void |
calcLocation()
This method is called when an information is requested from the location
|
protected void |
calcLocationFromElement() |
protected void |
calcLocationFromSource()
This method is called when the location information comes from an XML source
|
int |
getColumn()
The column.
|
int |
getLine()
The line number
|
int |
getLineStartOffset()
Offset at which the current line starts in the document
|
int |
getOffset() |
protected void |
moveToOffset(XMLSource source,
int offset)
This moves the line and column information by the text found in the source.
|
protected void |
nodeNotFound()
This method is called when you specify a child node of an element
but when the location is requested, this node cannot be found.
|
String |
toString() |
public Location(XMLSource source, int offset)
public Location(Element e)
public Location(Token token)
public int getOffset()
public int getLine()
public int getColumn()
public int getLineStartOffset()
protected void calcLocation()
protected void calcLocationFromSource()
protected void moveToOffset(XMLSource source, int offset)
protected void calcLocationFromElement()
protected void nodeNotFound()
By default, this method just resets the location but you can override it to throw an exception, if you like.
Copyright © 2008–2014. All rights reserved.