Interface DocumentWriter<T extends Element<T>>

Type Parameters:
T - root element type
All Superinterfaces:
Appendable<T>, AutoCloseable, Closeable

public interface DocumentWriter<T extends Element<T>> extends Closeable, Appendable<T>
Writer for documents with a certain root element type.
  • Method Details

    • noop

      static <T extends Element<T>> DocumentWriter<T> noop()
      Create a no-op implementation of DocumentWriter.
      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, 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.
      Type Parameters:
      R - root element type
      Parameters:
      rootElementName - root element name
      namespaceRegistry - namespace registry
      xmlFile - target XML file
      Returns:
      new document writer
      Throws:
      Exception - in case there's an error opening the XML file or preparing the XML writing infrastructure