Interface DocumentWriter<T extends Element<T>>
-
- Type Parameters:
T
- root element type
- All Superinterfaces:
Appendable<T>
,java.lang.AutoCloseable
,java.io.Closeable
public interface DocumentWriter<T extends Element<T>> extends java.io.Closeable, Appendable<T>
Writer for documents with a certain root element type.
-
-
Method Summary
Static Methods Modifier and Type Method Description static <R extends Element<R>>
DocumentWriter<R>create(org.opentest4j.reporting.schema.QualifiedName rootElementName, NamespaceRegistry namespaceRegistry, java.nio.file.Path xmlFile)
Create a new document writer with the supplied root element name and namespace registry that will write to the supplied XML file.static <T extends Element<T>>
DocumentWriter<T>noop()
Create a no-op implementation ofDocumentWriter
.-
Methods inherited from interface org.opentest4j.reporting.events.api.Appendable
append, append
-
-
-
-
Method Detail
-
noop
static <T extends Element<T>> DocumentWriter<T> noop()
Create a no-op implementation ofDocumentWriter
.- Type Parameters:
T
- root element type- Returns:
- no-op DocumentWriter
-
create
static <R extends Element<R>> DocumentWriter<R> create(org.opentest4j.reporting.schema.QualifiedName rootElementName, NamespaceRegistry namespaceRegistry, java.nio.file.Path xmlFile) throws java.lang.Exception
Create a new document writer with the supplied root element name and namespace registry that will write to the supplied XML file.- Type Parameters:
R
- root element type- Parameters:
rootElementName
- root element namenamespaceRegistry
- namespace registryxmlFile
- target XML file- Returns:
- new document writer
- Throws:
java.lang.Exception
- in case there's an error opening the XML file or preparing the XML writing infrastructure
-
-