Top Fields Constructors Methods
org.apache.xerces.stax.events

public final Class CommentImpl

extends XMLEventImpl
implements Comment
Class Inheritance
All Implemented Interfaces
javax.xml.stream.events.Comment, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
Imports
java.io.IOException, .Writer, javax.xml.stream.Location, .XMLStreamException, javax.xml.stream.events.Comment

Author
Lucian Holland
Version
$Id: CommentImpl.java 730471 2008-12-31 20:45:32Z mrglavas $

Field Summary

Modifier and TypeField and Description
private final String
fText

The text of the comment.

Constructor Summary

AccessConstructor and Description
public
CommentImpl(final String text, final Location location)

Method Summary

Modifier and TypeMethod and Description
public String
getText()

Implements javax.xml.stream.events.Comment.getText.

Return the string data of the comment, returns empty string if it does not exist.
public void
writeAsEncodedUnicode(Writer
The writer that will output the data
writer
)

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

This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
Inherited from org.apache.xerces.stax.events.XMLEventImpl:
asCharactersasEndElementasStartElementgetEventTypegetLocationgetSchemaTypeisAttributeisCharactersisEndDocumentisEndElementisEntityReferenceisNamespaceisProcessingInstructionisStartDocumentisStartElementtoString

Field Detail

fTextback to summary
private final String fText

The text of the comment. Will be the empty string if there's no body text in the comment.

Constructor Detail

CommentImplback to summary
public CommentImpl(final String text, final Location location)

Method Detail

getTextback to summary
public String getText()

Implements javax.xml.stream.events.Comment.getText.

Doc from javax.xml.stream.events.Comment.getText.

Return the string data of the comment, returns empty string if it does not exist.

Returns:String

the string data of the comment

See Also
javax.xml.stream.events.Comment#getText()
writeAsEncodedUnicodeback to summary
public void writeAsEncodedUnicode(Writer writer) throws XMLStreamException

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

The writer that will output the data

Exceptions
XMLStreamException:
if there is a fatal error writing the event