Top Fields Constructors Methods
org.codehaus.stax2.ri.evt

public Class CharactersEventImpl

extends BaseEventImpl
implements Characters
Class Inheritance
All Implemented Interfaces
javax.xml.stream.events.Characters, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
Imports
java.io.IOException, .Writer, javax.xml.stream.*, javax.xml.stream.events.Characters, org.codehaus.stax2.XMLStreamWriter2

Field Summary

Modifier and TypeField and Description
pack-priv final String
pack-priv final boolean
pack-priv final boolean
pack-priv boolean
pack-priv boolean
Inherited from org.codehaus.stax2.ri.evt.BaseEventImpl:
mLocation

Constructor Summary

AccessConstructor and Description
public
CharactersEventImpl(Location loc, String content, boolean cdata)

Constructor for regular unspecified (but non-CDATA) characters event type, which may or may not be all whitespace, but is not specified as ignorable white space.

private
CharactersEventImpl(Location loc, String content, boolean cdata, boolean allWS, boolean ignorableWS)

Constructor for creating white space characters...

Method Summary

Modifier and TypeMethod and Description
public Characters
asCharacters()

Overrides org.codehaus.stax2.ri.evt.BaseEventImpl.asCharacters.

Implements javax.xml.stream.events.XMLEvent.asCharacters.

Returns this event as Characters, may result in a class cast exception if this event is not Characters.
public static final CharactersEventImpl
public static final CharactersEventImpl
public boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.equals.

Declared abstract to force redefinition by sub-classes
public String
getData()

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

Get the character data of this event
public int
getEventType()

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.getEventType.

Implements javax.xml.stream.events.XMLEvent.getEventType.

Returns an integer code for this event.
public int
hashCode()

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.hashCode.

Declared abstract to force redefinition by sub-classes
public boolean
isCData()

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

Returns true if this is a CData section.
public boolean
isCharacters()

Overrides org.codehaus.stax2.ri.evt.BaseEventImpl.isCharacters.

Implements javax.xml.stream.events.XMLEvent.isCharacters.

A utility function to check if this event is Characters.
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
setWhitespaceStatus(boolean status)

public void
writeAsEncodedUnicode(Writer
The writer that will output the data
w
)

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.writeAsEncodedUnicode.

Implements javax.xml.stream.events.XMLEvent.writeAsEncodedUnicode.

This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
protected static void
public void
Inherited from org.codehaus.stax2.ri.evt.BaseEventImpl:
addHashasEndElementasStartElementgetLocationgetSchemaTypeisAttributeisEndDocumentisEndElementisEntityReferenceisNamespaceisProcessingInstructionisStartDocumentisStartElementiteratedEqualsstringsWithNullsEqualthrowFromIOEtoString

Field Detail

mContentback to summary
pack-priv final String mContent
mIgnorableWSback to summary
pack-priv final boolean mIgnorableWS
mIsCDataback to summary
pack-priv final boolean mIsCData
mIsWhitespaceback to summary
pack-priv boolean mIsWhitespace
mWhitespaceCheckedback to summary
pack-priv boolean mWhitespaceChecked

Constructor Detail

CharactersEventImplback to summary
public CharactersEventImpl(Location loc, String content, boolean cdata)

Constructor for regular unspecified (but non-CDATA) characters event type, which may or may not be all whitespace, but is not specified as ignorable white space.

CharactersEventImplback to summary
private CharactersEventImpl(Location loc, String content, boolean cdata, boolean allWS, boolean ignorableWS)

Constructor for creating white space characters...

Method Detail

asCharactersback to summary
public Characters asCharacters()

Overrides org.codehaus.stax2.ri.evt.BaseEventImpl.asCharacters.

Implements javax.xml.stream.events.XMLEvent.asCharacters.

Doc from javax.xml.stream.events.XMLEvent.asCharacters.

Returns this event as Characters, may result in a class cast exception if this event is not Characters.

Returns:Characters

a Characters event

Annotations
@Override
createIgnorableWSback to summary
public static final CharactersEventImpl createIgnorableWS(Location loc, String content)
createNonIgnorableWSback to summary
public static final CharactersEventImpl createNonIgnorableWS(Location loc, String content)
equalsback to summary
public boolean equals(Object o)

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.equals.

Doc from org.codehaus.stax2.ri.evt.BaseEventImpl.equals.

Declared abstract to force redefinition by sub-classes

Parameters
o:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
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

the character data

Annotations
@Override
getEventTypeback to summary
public int getEventType()

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.getEventType.

Implements javax.xml.stream.events.XMLEvent.getEventType.

Doc from javax.xml.stream.events.XMLEvent.getEventType.

Returns an integer code for this event.

Returns:int

the event type

Annotations
@Override
hashCodeback to summary
public int hashCode()

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.hashCode.

Doc from org.codehaus.stax2.ri.evt.BaseEventImpl.hashCode.

Declared abstract to force redefinition by sub-classes

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
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

true if it is CDATA, false otherwise

Annotations
@Override
isCharactersback to summary
public boolean isCharacters()

Overrides org.codehaus.stax2.ri.evt.BaseEventImpl.isCharacters.

Implements javax.xml.stream.events.XMLEvent.isCharacters.

Doc from javax.xml.stream.events.XMLEvent.isCharacters.

A utility function to check if this event is Characters.

Returns:boolean

true if the event is Characters, false otherwise

Annotations
@Override
isIgnorableWhiteSpaceback to summary
public boolean isIgnorableWhiteSpace()

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

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

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

Returns:boolean

true if it is ignorable whitespace, false otherwise

Annotations
@Override
isWhiteSpaceback to summary
public boolean isWhiteSpace()

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

Doc from 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

Returns:boolean

true if the Characters are all whitespace, false otherwise

Annotations
@Override
setWhitespaceStatusback to summary
public void setWhitespaceStatus(boolean status)
writeAsEncodedUnicodeback to summary
public void writeAsEncodedUnicode(Writer w) throws XMLStreamException

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.writeAsEncodedUnicode.

Implements javax.xml.stream.events.XMLEvent.writeAsEncodedUnicode.

Doc from javax.xml.stream.events.XMLEvent.writeAsEncodedUnicode.

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
w:Writer

The writer that will output the data

Annotations
@Override
Exceptions
XMLStreamException:
if there is a fatal error writing the event
writeEscapedXMLTextback to summary
protected static void writeEscapedXMLText(Writer w, String text) throws IOException
writeUsingback to summary
public void writeUsing(XMLStreamWriter2 w) throws XMLStreamException

Implements abstract org.codehaus.stax2.ri.evt.BaseEventImpl.writeUsing.

Implements org.codehaus.stax2.evt.XMLEvent2.writeUsing.

Annotations
@Override