Package org.simpleframework.xml.stream
Class DocumentReader.Text
- java.lang.Object
-
- org.simpleframework.xml.stream.EventToken
-
- org.simpleframework.xml.stream.DocumentReader.Text
-
- Enclosing class:
- DocumentReader
private static class DocumentReader.Text extends EventToken
TheText
object is used to represent a text event. If wraps a node that holds text consumed from the document. These are used byInputNode
objects to extract the text values for elements For debugging this exposes the node.
-
-
Field Summary
Fields Modifier and Type Field Description private org.w3c.dom.Node
node
This is the node that is used to represent the text value.
-
Constructor Summary
Constructors Constructor Description Text(org.w3c.dom.Node node)
Constructor for theText
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getSource()
This is used to return the node for the event.java.lang.String
getValue()
This returns the value of the event.boolean
isText()
This is true as this event represents a text token.-
Methods inherited from class org.simpleframework.xml.stream.EventToken
getLine, getName, getPrefix, getReference, isEnd, isStart, iterator
-
-
-
-
Method Detail
-
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
public java.lang.String 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
public java.lang.Object getSource()
This is used to return the node for the event. Because this represents a DOM text value the DOM node will be 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 event
-
-