Package org.simpleframework.xml.stream
Class InputPosition
- java.lang.Object
-
- org.simpleframework.xml.stream.InputPosition
-
- All Implemented Interfaces:
Position
class InputPosition extends java.lang.Object implements Position
TheInputPosition
object is used to acquire the line number within the XML document. This allows debugging to be done when a problem occurs with the source document. This object can be converted to a string using thetoString
method.
-
-
Constructor Summary
Constructors Constructor Description InputPosition(EventNode source)
Constructor for theInputPosition
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getLine()
This is the actual line number within the read XML document.java.lang.String
toString()
This provides a textual description of the position the read cursor is at within the XML document.
-
-
-
Field Detail
-
source
private EventNode source
This is the XML event that the position is acquired for.
-
-
Constructor Detail
-
InputPosition
public InputPosition(EventNode source)
Constructor for theInputPosition
object. This is used to create a position description if the provided event is not null. This will return -1 if the specified event does not provide any location information.- Parameters:
source
- this is the XML event to get the position of
-
-
Method Detail
-
getLine
public int getLine()
This is the actual line number within the read XML document. The line number allows any problems within the source XML document to be debugged if it does not match the schema. This will return -1 if the line number cannot be determined.
-
toString
public java.lang.String toString()
This provides a textual description of the position the read cursor is at within the XML document. This allows the position to be embedded within the exception thrown.
-
-