Package org.simpleframework.xml.stream
Class PullReader.Text
java.lang.Object
org.simpleframework.xml.stream.EventToken
org.simpleframework.xml.stream.PullReader.Text
- Enclosing class:
PullReader
The
Text
object is used to represent a text event.
If wraps a node that holds text consumed from the document.
These are used by InputNode
objects to extract the
text values for elements For debugging this exposes the node.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.simpleframework.xml.stream.EventToken
getLine, getName, getPrefix, getReference, isEnd, isStart, iterator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
source
private final org.xmlpull.v1.XmlPullParser sourceThis is the XML pull parser used to extract this text event. -
text
This is the text value that has been extracted from the XML.
-
-
Constructor Details
-
Text
public Text(org.xmlpull.v1.XmlPullParser source) Constructor for theText
object. This creates an event that provides text to the core reader. Text can be in the form of a CDATA section or a normal text entry.- Parameters:
source
- this is the node that represents the text value
-
-
Method Details
-
isText
public boolean isText()This is true as this event represents a text token. Text tokens are required to provide a value only. So namespace details and the node name will always return null.- Specified by:
isText
in interfaceEventNode
- Overrides:
isText
in classEventToken
- Returns:
- this returns true as this event represents text
-
getValue
This returns the value of the event. This will return the text value contained within the node. If there is no text within the node this should return an empty string.- Specified by:
getValue
in interfaceEventNode
- Overrides:
getValue
in classEventToken
- Returns:
- this returns the value represented by this event
-
getSource
This is used to return the node for the text. Because this represents an XML event the XML parser is returned. Returning the node helps with certain debugging issues.- Specified by:
getSource
in interfaceEventNode
- Overrides:
getSource
in classEventToken
- Returns:
- this will return the source object for this
-