Package de.pdark.decentxml
Class Location
- java.lang.Object
-
- de.pdark.decentxml.Location
-
public class Location extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Location.NodeFoundException
This is just a marker that the node has been foundstatic class
Location.ReusableXMLSource
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
calcLocation()
This method is called when an information is requested from the locationprotected void
calcLocationFromElement()
protected void
calcLocationFromSource()
This method is called when the location information comes from an XML sourceint
getColumn()
The column.int
getLine()
The line numberint
getLineStartOffset()
Offset at which the current line starts in the documentint
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.java.lang.String
toString()
-
-
-
Method Detail
-
getOffset
public int getOffset()
-
getLine
public int getLine()
The line number
-
getColumn
public int getColumn()
The column. Tab is 8 character wide
-
getLineStartOffset
public int getLineStartOffset()
Offset at which the current line starts in the document
-
calcLocation
protected void calcLocation()
This method is called when an information is requested from the location
-
calcLocationFromSource
protected void calcLocationFromSource()
This method is called when the location information comes from an XML source
-
moveToOffset
protected void moveToOffset(XMLSource source, int offset)
This moves the line and column information by the text found in the source.
-
calcLocationFromElement
protected void calcLocationFromElement()
-
nodeNotFound
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.By default, this method just resets the location but you can override it to throw an exception, if you like.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-