Class XMLStreamRecorder
java.lang.Object
com.bea.xml.stream.ReaderToWriter
com.bea.xml.stream.XMLWriterBase
com.bea.xml.stream.XMLStreamRecorder
- All Implemented Interfaces:
XMLStreamWriter
Writes XML in a non-xml format to create XML tests.
-
Field Summary
Fields inherited from class XMLWriterBase
context, DEFAULTNS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidstatic voidprotected voidprotected voidvoidwrite(XMLStreamReader xmlr) voidwriteAttribute(String namespaceURI, String localName, String value) Writes an attribute to the output streamvoidwriteCData(String data) Writes a CData sectionprotected voidwriteCharactersInternal(char[] characters, int start, int length, boolean isAttributeValue) voidwriteComment(String data) Writes an xml comment with the data enclosedvoidwriteDefaultNamespace(String namespaceURI) Writes the default namespace to the streamvoidWrite a DTD section.voidwriteEntityRef(String name) Writes an entity referenceprotected StringvoidwriteNamespace(String prefix, String namespaceURI) Writes a namespace to the output stream If the prefix argument to this method is the empty string, "xmlns", or null this method will delegate to writeDefaultNamespacevoidwriteProcessingInstruction(String target, String text) Writes a processing instructionvoidWrite the XML Declaration.voidwriteStartDocument(String version) Write the XML Declaration.voidwriteStartDocument(String encoding, String version) Write the XML Declaration.protected voidwriteType(int type) Methods inherited from class XMLWriterBase
close, closeStartElement, flush, getNamespaceContext, getPrefix, getProperty, getURIInternal, isOpen, setConfigurationContext, setDefaultNamespace, setNamespaceContext, setPrefix, setWriter, write, write, write, write, writeAttribute, writeAttribute, writeCharacters, writeCharacters, writeEmptyElement, writeEmptyElement, writeEmptyElement, writeEndDocument, writeEndElement, writeProcessingInstruction, writeRaw, writeStartElement, writeStartElement, writeStartElement, writeStartElementInternalMethods inherited from class ReaderToWriter
setStreamWriter, writeAll
-
Constructor Details
-
XMLStreamRecorder
public XMLStreamRecorder() -
XMLStreamRecorder
-
-
Method Details
-
writeName
protected String writeName(String prefix, String namespaceURI, String localName) throws XMLStreamException - Overrides:
writeNamein classXMLWriterBase- Throws:
XMLStreamException
-
writeType
- Throws:
XMLStreamException
-
openStartTag
- Overrides:
openStartTagin classXMLWriterBase- Throws:
XMLStreamException
-
closeStartTag
- Overrides:
closeStartTagin classXMLWriterBase- Throws:
XMLStreamException
-
openEndTag
- Overrides:
openEndTagin classXMLWriterBase- Throws:
XMLStreamException
-
closeEndTag
- Overrides:
closeEndTagin classXMLWriterBase- Throws:
XMLStreamException
-
writeAttribute
public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException Description copied from interface:javax.xml.stream.XMLStreamWriterWrites an attribute to the output stream- Specified by:
writeAttributein interfaceXMLStreamWriter- Overrides:
writeAttributein classXMLWriterBase- Parameters:
namespaceURI- the uri of the prefix for this attributelocalName- the local name of the attributevalue- the value of the attribute- Throws:
XMLStreamException- if the namespace URI has not been bound to a prefix and javax.xml.stream.isPrefixDefaulting has not been set to true
-
writeNamespace
Description copied from interface:javax.xml.stream.XMLStreamWriterWrites a namespace to the output stream If the prefix argument to this method is the empty string, "xmlns", or null this method will delegate to writeDefaultNamespace- Specified by:
writeNamespacein interfaceXMLStreamWriter- Overrides:
writeNamespacein classXMLWriterBase- Parameters:
prefix- the prefix to bind this namespace tonamespaceURI- the uri to bind the prefix to- Throws:
XMLStreamException
-
writeDefaultNamespace
Description copied from interface:javax.xml.stream.XMLStreamWriterWrites the default namespace to the stream- Specified by:
writeDefaultNamespacein interfaceXMLStreamWriter- Overrides:
writeDefaultNamespacein classXMLWriterBase- Parameters:
namespaceURI- the uri to bind the default namespace to- Throws:
XMLStreamException
-
writeComment
Description copied from interface:javax.xml.stream.XMLStreamWriterWrites an xml comment with the data enclosed- Specified by:
writeCommentin interfaceXMLStreamWriter- Overrides:
writeCommentin classXMLWriterBase- Parameters:
data- the data contained in the comment, may be null- Throws:
XMLStreamException
-
writeProcessingInstruction
Description copied from interface:javax.xml.stream.XMLStreamWriterWrites a processing instruction- Specified by:
writeProcessingInstructionin interfaceXMLStreamWriter- Overrides:
writeProcessingInstructionin classXMLWriterBase- Parameters:
target- the target of the processing instruction, may not be nulltext- the data contained in the processing instruction, may not be null- Throws:
XMLStreamException
-
writeDTD
Description copied from interface:javax.xml.stream.XMLStreamWriterWrite a DTD section. This string represents the entire doctypedecl production from the XML 1.0 specification.- Specified by:
writeDTDin interfaceXMLStreamWriter- Overrides:
writeDTDin classXMLWriterBase- Parameters:
dtd- the DTD to be written- Throws:
XMLStreamException
-
writeCData
Description copied from interface:javax.xml.stream.XMLStreamWriterWrites a CData section- Specified by:
writeCDatain interfaceXMLStreamWriter- Overrides:
writeCDatain classXMLWriterBase- Parameters:
data- the data contained in the CData Section, may not be null- Throws:
XMLStreamException
-
writeEntityRef
Description copied from interface:javax.xml.stream.XMLStreamWriterWrites an entity reference- Specified by:
writeEntityRefin interfaceXMLStreamWriter- Overrides:
writeEntityRefin classXMLWriterBase- Parameters:
name- the name of the entity- Throws:
XMLStreamException
-
writeStartDocument
Description copied from interface:javax.xml.stream.XMLStreamWriterWrite the XML Declaration. Defaults the XML version to 1.0, and the encoding to utf-8- Specified by:
writeStartDocumentin interfaceXMLStreamWriter- Overrides:
writeStartDocumentin classXMLWriterBase- Throws:
XMLStreamException
-
writeStartDocument
Description copied from interface:javax.xml.stream.XMLStreamWriterWrite the XML Declaration. Defaults the XML version to 1.0- Specified by:
writeStartDocumentin interfaceXMLStreamWriter- Overrides:
writeStartDocumentin classXMLWriterBase- Parameters:
version- version of the xml document- Throws:
XMLStreamException
-
writeStartDocument
Description copied from interface:javax.xml.stream.XMLStreamWriterWrite the XML Declaration. Note that the encoding parameter does not set the actual encoding of the underlying output. That must be set when the instance of the XMLStreamWriter is created using the XMLOutputFactory- Specified by:
writeStartDocumentin interfaceXMLStreamWriter- Overrides:
writeStartDocumentin classXMLWriterBase- Parameters:
encoding- encoding of the xml declarationversion- version of the xml document- Throws:
XMLStreamException
-
writeCharactersInternal
protected void writeCharactersInternal(char[] characters, int start, int length, boolean isAttributeValue) throws XMLStreamException - Overrides:
writeCharactersInternalin classXMLWriterBase- Throws:
XMLStreamException
-
write
- Overrides:
writein classReaderToWriter- Throws:
XMLStreamException
-
main
-