Package org.simpleframework.xml.stream
Class InputPosition
java.lang.Object
org.simpleframework.xml.stream.InputPosition
- All Implemented Interfaces:
Position
The
InputPosition
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 the toString
method.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
source
This is the XML event that the position is acquired for.
-
-
Constructor Details
-
InputPosition
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 Details
-
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
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.
-