Top Fields Constructors Methods
org.opentest4j.reporting.events.api

pack-priv Class DefaultDocumentWriter<T extends Element<T>>

extends Object
implements DocumentWriter<T extends Element<T>>
Class Inheritance
All Implemented Interfaces
org.opentest4j.reporting.events.api.DocumentWriter, org.opentest4j.reporting.events.api.Appendable, java.io.Closeable, java.lang.AutoCloseable
Imports
org.opentest4j.reporting.schema.Namespace, .QualifiedName, javax.xml.stream.XMLOutputFactory, .XMLStreamException, .XMLStreamWriter, javax.xml.transform.OutputKeys, .Transformer, .TransformerFactory, javax.xml.transform.dom.DOMSource, javax.xml.transform.stax.StAXResult, java.io.BufferedWriter, .IOException, .Writer, java.util.Optional, java.util.function.Consumer

Field Summary

Modifier and TypeField and Description
private final Context
private final SingleElementXMLStreamWriter
private final AttributeValueEscapingWriter
private final Transformer
private final XMLStreamWriter

Constructor Summary

AccessConstructor and Description
pack-priv
DefaultDocumentWriter(QualifiedName rootElementName, NamespaceRegistry namespaceRegistry, Writer writer)

Method Summary

Modifier and TypeMethod and Description
public synchronized <C extends ChildElement<T, ? super C>> DocumentWriter<T>
append(Factory<C>
child element factory
creator
,
Consumer<? super C>
child element configurer
configurer
)

Implements org.opentest4j.reporting.events.api.Appendable.append.

Append the child element created by the supplied factory configured by the supplied consumer.

private static BufferedWriter
buffered(Writer writer)

public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

private void
private void
private void
private void
writeStartElement(QualifiedName rootElement, NamespaceRegistry namespaceRegistry)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
private final Context context
elementXmlWriterback to summary
private final SingleElementXMLStreamWriter elementXmlWriter
outback to summary
private final AttributeValueEscapingWriter out
transformerback to summary
private final Transformer transformer
xmlWriterback to summary
private final XMLStreamWriter xmlWriter

Constructor Detail

DefaultDocumentWriterback to summary
pack-priv DefaultDocumentWriter(QualifiedName rootElementName, NamespaceRegistry namespaceRegistry, Writer writer) throws Exception

Method Detail

appendback to summary
public synchronized <C extends ChildElement<T, ? super C>> DocumentWriter<T> append(Factory<C> creator, Consumer<? super C> configurer)

Implements org.opentest4j.reporting.events.api.Appendable.append.

Doc from org.opentest4j.reporting.events.api.Appendable.append.

Append the child element created by the supplied factory configured by the supplied consumer.

Parameters
<C>
child element type
creator:Factory<C>

child element factory

configurer:Consumer<? super C>

child element configurer

Returns:DocumentWriter<T>

self reference to allow method chaining

Annotations
@Override
bufferedback to summary
private static BufferedWriter buffered(Writer writer)
closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
writeNamespacesback to summary
private void writeNamespaces(NamespaceRegistry namespaceRegistry) throws XMLStreamException
writeNewLineback to summary
private void writeNewLine() throws IOException, XMLStreamException
writeSchemaLocationsback to summary
private void writeSchemaLocations(NamespaceRegistry namespaceRegistry) throws XMLStreamException
writeStartElementback to summary
private void writeStartElement(QualifiedName rootElement, NamespaceRegistry namespaceRegistry) throws XMLStreamException