APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.xml.internal.stream.events

public Class CharacterEvent

extends DummyEvent
implements Characters
Class Inheritance
All Implemented Interfaces
javax.xml.stream.events.Characters, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
Imports
javax.xml.stream.events.Characters, .XMLEvent, java.io.Writer, .IOException, com.sun.org.apache.xerces.internal.util.XMLChar

Implementation of Character event.
Authors
Neeraj Bajaj, Sun Microsystems, K.Venugopal, Sun Microsystems

Field Summary

Modifier and TypeField and Description
private boolean
private String
private boolean
private boolean
private boolean
Inherited from com.sun.xml.internal.stream.events.DummyEvent:
fLocation

Constructor Summary

AccessConstructor and Description
public
public
CharacterEvent(String
Character Data.
data
)

public
CharacterEvent(String
Character Data.
data
,
boolean
true if CData
flag
)

public
CharacterEvent(String
Character Data.
data
,
boolean
true if CData
flag
,
boolean
true if data is ignorable whitespace.
isIgnorableWhiteSpace
)

Method Summary

Modifier and TypeMethod and Description
private void
public String

Returns:

return data.
getData
()

Implements javax.xml.stream.events.Characters.getData.

Get the character data of this event

protected void
init()

public boolean

Returns:

boolean returns true if the data is CData
isCData
()

Implements javax.xml.stream.events.Characters.isCData.

Returns true if this is a CData section.

public boolean
isIgnorableWhiteSpace()

Implements javax.xml.stream.events.Characters.isIgnorableWhiteSpace.

Return true if this is ignorableWhiteSpace.

public boolean
isWhiteSpace()

Implements javax.xml.stream.events.Characters.isWhiteSpace.

Returns true if this set of Characters is all whitespace.

public void
public String

Returns:

String return the String representation of this event.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

protected void
writeAsEncodedUnicodeEx(Writer
The writer that will output the data
writer
)

Implements abstract com.sun.xml.internal.stream.events.DummyEvent.writeAsEncodedUnicodeEx.

This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.

Inherited from com.sun.xml.internal.stream.events.DummyEvent:
asCharactersasEndElementasStartElementcharEncodegetEventTypegetLocationgetSchemaTypeisAttributeisCharacterDataisCharactersisEndDocumentisEndElementisEntityReferenceisNamespaceisProcessingInstructionisStartDocumentisStartElementsetEventTypesetLocationwriteAsEncodedUnicode

Field Detail

fCheckIfSpaceNeededback to summary
private boolean fCheckIfSpaceNeeded
fDataback to summary
private String fData
fIsCDataback to summary
private boolean fIsCData
fIsIgnorableWhitespaceback to summary
private boolean fIsIgnorableWhitespace
fIsSpaceback to summary
private boolean fIsSpace

Constructor Detail

CharacterEventback to summary
public CharacterEvent()
CharacterEventback to summary
public CharacterEvent(String data)
Parameters
data:String

Character Data.

CharacterEventback to summary
public CharacterEvent(String data, boolean flag)
Parameters
data:String

Character Data.

flag:boolean

true if CData

CharacterEventback to summary
public CharacterEvent(String data, boolean flag, boolean isIgnorableWhiteSpace)
Parameters
data:String

Character Data.

flag:boolean

true if CData

isIgnorableWhiteSpace:boolean

true if data is ignorable whitespace.

Method Detail

checkWhiteSpaceback to summary
private void checkWhiteSpace()
getDataback to summary
public String getData()

Implements javax.xml.stream.events.Characters.getData.

Doc from javax.xml.stream.events.Characters.getData.

Get the character data of this event

Returns:String

return data.

initback to summary
protected void init()
isCDataback to summary
public boolean isCData()

Implements javax.xml.stream.events.Characters.isCData.

Doc from javax.xml.stream.events.Characters.isCData.

Returns true if this is a CData section. If this event is CData its event type will be CDATA If javax.xml.stream.isCoalescing is set to true CDATA Sections that are surrounded by non CDATA characters will be reported as a single Characters event. This method will return false in this case.

Returns:boolean

boolean returns true if the data is CData

isIgnorableWhiteSpaceback to summary
public boolean isIgnorableWhiteSpace()

Implements javax.xml.stream.events.Characters.isIgnorableWhiteSpace.

Return true if this is ignorableWhiteSpace. If this event is ignorableWhiteSpace its event type will be SPACE.

isWhiteSpaceback to summary
public boolean isWhiteSpace()

Implements javax.xml.stream.events.Characters.isWhiteSpace.

Returns true if this set of Characters is all whitespace. Whitespace inside a document is reported as CHARACTERS. This method allows checking of CHARACTERS events to see if they are composed of only whitespace characters

setDataback to summary
public void setData(String data)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

String return the String representation of this event.

writeAsEncodedUnicodeExback to summary
protected void writeAsEncodedUnicodeEx(Writer writer) throws IOException

Implements abstract com.sun.xml.internal.stream.events.DummyEvent.writeAsEncodedUnicodeEx.

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.

Parameters
writer:Writer

The writer that will output the data

Exceptions
IOException:

Doc from com.sun.xml.internal.stream.events.DummyEvent.writeAsEncodedUnicodeEx.

if there is an IO error

XMLStreamException:
if there is a fatal error writing the event