Class NamespaceRegistry


  • public class NamespaceRegistry
    extends java.lang.Object
    Registry of namespaces for writing a document.
    See Also:
    Namespace, DocumentWriter
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static NamespaceRegistry.Builder builder​(org.opentest4j.reporting.schema.Namespace defaultNamespace)
      Create a new builder with the supplied default namespace.
      static NamespaceRegistry.Builder builder​(org.opentest4j.reporting.schema.Namespace defaultNamespace, java.lang.String schemaLocation)
      Create a new builder with the supplied default namespace and schema location.
      boolean containsUri​(java.lang.String uri)
      Check whether a namespace with the supplied URI is registered with this registry.
      java.util.Set<org.opentest4j.reporting.schema.Namespace> getAdditionalNamespaces()
      Get additional namespaces registered with this registry.
      org.opentest4j.reporting.schema.Namespace getDefaultNamespace()
      Get the default namespace of this registry.
      java.util.Optional<java.lang.String> getPrefix​(org.opentest4j.reporting.schema.Namespace namespace)
      Get the prefix for the supplied namespace registered with this registry.
      java.util.Map<org.opentest4j.reporting.schema.Namespace,​java.lang.String> getSchemaLocations()
      Get all schema locations registered with this registry.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • builder

        public static NamespaceRegistry.Builder builder​(org.opentest4j.reporting.schema.Namespace defaultNamespace)
        Create a new builder with the supplied default namespace.
        Parameters:
        defaultNamespace - the default namespace
        Returns:
        a new builder
      • builder

        public static NamespaceRegistry.Builder builder​(org.opentest4j.reporting.schema.Namespace defaultNamespace,
                                                        java.lang.String schemaLocation)
        Create a new builder with the supplied default namespace and schema location.
        Parameters:
        defaultNamespace - the default namespace
        schemaLocation - the schema location of the default namespace
        Returns:
        a new builder
      • getDefaultNamespace

        public org.opentest4j.reporting.schema.Namespace getDefaultNamespace()
        Get the default namespace of this registry.
        Returns:
        the default namespace
      • getAdditionalNamespaces

        public java.util.Set<org.opentest4j.reporting.schema.Namespace> getAdditionalNamespaces()
        Get additional namespaces registered with this registry.
        Returns:
        additional namespaces
      • getPrefix

        public java.util.Optional<java.lang.String> getPrefix​(org.opentest4j.reporting.schema.Namespace namespace)
        Get the prefix for the supplied namespace registered with this registry.
        Parameters:
        namespace - the namespace to look up the prefix for
        Returns:
        the prefix for the namespace or empty if the namespace is not as an additional namespace
      • getSchemaLocations

        public java.util.Map<org.opentest4j.reporting.schema.Namespace,​java.lang.String> getSchemaLocations()
        Get all schema locations registered with this registry.
        Returns:
        schema locations
      • containsUri

        public boolean containsUri​(java.lang.String uri)
        Check whether a namespace with the supplied URI is registered with this registry.
        Parameters:
        uri - the namespace URI to look up
        Returns:
        whether the namespace is registered