Top Description Methods
org.opentest4j.reporting.events.api

public Interface DocumentWriter<T extends Element<T>>

extends Closeable, Appendable<T extends Element<T>>
Known Direct Implementers
org.opentest4j.reporting.events.api.DefaultDocumentWriter
Type Parameters
<T>
root element type
Imports
org.opentest4j.reporting.schema.QualifiedName, java.io.Closeable, java.nio.file.Files, .Path, java.util.function.Consumer

Writer for documents with a certain root element type.

Method Summary

Modifier and TypeMethod and Description
public static <
root element type
R extends Element<R>
>
DocumentWriter<R>

Returns:

new document writer
create
(QualifiedName
root element name
rootElementName
,
NamespaceRegistry
namespace registry
namespaceRegistry
,
Path
target XML file
xmlFile
)

Create a new document writer with the supplied root element name and namespace registry that will write to the supplied XML file.

public static <
root element type
T extends Element<T>
>
DocumentWriter<T>

Returns:

no-op DocumentWriter
noop
()

Create a no-op implementation of DocumentWriter.

Inherited from java.io.Closeable:
close
Inherited from org.opentest4j.reporting.events.api.Appendable:
appendappend

Method Detail

createback to summary
public static <R extends Element<R>> DocumentWriter<R> create(QualifiedName rootElementName, NamespaceRegistry namespaceRegistry, Path xmlFile) throws Exception

Create a new document writer with the supplied root element name and namespace registry that will write to the supplied XML file.

Parameters
<R>
root element type
rootElementName:QualifiedName

root element name

namespaceRegistry:NamespaceRegistry

namespace registry

xmlFile:Path

target XML file

Returns:DocumentWriter<R>

new document writer

Exceptions
Exception:
in case there's an error opening the XML file or preparing the XML writing infrastructure
noopback to summary
public static <T extends Element<T>> DocumentWriter<T> noop()

Create a no-op implementation of DocumentWriter.

Parameters
<T>
root element type
Returns:DocumentWriter<T>

no-op DocumentWriter