com.sun.xml.stream.events
Class CharacterEvent
java.lang.Object
com.sun.xml.stream.events.DummyEvent
com.sun.xml.stream.events.CharacterEvent
- All Implemented Interfaces:
- javax.xml.stream.events.Characters, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
public class CharacterEvent
- extends DummyEvent
- implements javax.xml.stream.events.Characters
Implementation of Character event.
- Author:
- Neeraj Bajaj, Sun Microsystems, K.Venugopal, Sun Microsystems
Fields inherited from interface javax.xml.stream.XMLStreamConstants |
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT |
Method Summary |
java.lang.String |
getData()
|
protected void |
init()
|
boolean |
isCData()
|
boolean |
isIgnorableWhiteSpace()
Return true if this is ignorableWhiteSpace. |
boolean |
isWhiteSpace()
Returns true if this set of Characters
is all whitespace. |
void |
setData(java.lang.String data)
|
java.lang.String |
toString()
|
void |
writeAsEncodedUnicode(java.io.Writer writer)
This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters. |
Methods inherited from class com.sun.xml.stream.events.DummyEvent |
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacterData, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, setEventType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.xml.stream.events.XMLEvent |
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement |
CharacterEvent
public CharacterEvent()
CharacterEvent
public CharacterEvent(java.lang.String data)
- Parameters:
data
- Character Data.
CharacterEvent
public CharacterEvent(java.lang.String data,
boolean flag)
- Parameters:
data
- Character Data.flag
- true if CData
CharacterEvent
public CharacterEvent(java.lang.String data,
boolean flag,
boolean isIgnorableWhiteSpace)
- Parameters:
data
- Character Data.flag
- true if CDataisIgnorableWhiteSpace
- true if data is ignorable whitespace.
init
protected void init()
getData
public java.lang.String getData()
- Specified by:
getData
in interface javax.xml.stream.events.Characters
- Returns:
- return data.
setData
public void setData(java.lang.String data)
- Parameters:
String
- data
isCData
public boolean isCData()
- Specified by:
isCData
in interface javax.xml.stream.events.Characters
- Returns:
- boolean returns true if the data is CData
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- Returns:
- String return the String representation of this event.
writeAsEncodedUnicode
public void writeAsEncodedUnicode(java.io.Writer writer)
throws javax.xml.stream.XMLStreamException
- This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
No indentation or whitespace should be outputted.
Any user defined event type SHALL have this method
called when being written to on an output stream.
Built in Event types MUST implement this method,
but implementations MAY choose not call these methods
for optimizations reasons when writing out built in
Events to an output stream.
The output generated MUST be equivalent in terms of the
infoset expressed.
- Specified by:
writeAsEncodedUnicode
in interface javax.xml.stream.events.XMLEvent
- Overrides:
writeAsEncodedUnicode
in class DummyEvent
- Parameters:
writer
- The writer that will output the data
- Throws:
XMLStreamException
- if there is a fatal error writing the event
isIgnorableWhiteSpace
public boolean isIgnorableWhiteSpace()
- Return true if this is ignorableWhiteSpace. If
this event is ignorableWhiteSpace its event type will
be SPACE.
- Specified by:
isIgnorableWhiteSpace
in interface javax.xml.stream.events.Characters
- Returns:
isWhiteSpace
public boolean isWhiteSpace()
- Returns true if this set of Characters
is all whitespace. Whitspace inside a document
is reported as CHARACTERS. This method allows
checking of CHARACTERS events to see if they
are composed of only whitespace characters
- Specified by:
isWhiteSpace
in interface javax.xml.stream.events.Characters
- Returns:
Copyright ? 2002-2003 Apache XML Project. All Rights Reserved.