Class NamespaceRegistry
- java.lang.Object
-
- org.opentest4j.reporting.events.api.NamespaceRegistry
-
public class NamespaceRegistry extends java.lang.Object
Registry of namespaces for writing a document.- See Also:
Namespace
,DocumentWriter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NamespaceRegistry.Builder
Builder forNamespaceRegistry
.
-
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.
-
-
-
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 namespaceschemaLocation
- 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
-
-