Top Description Inners Fields Constructors Methods
org.opentest4j.reporting.events.api

public Class NamespaceRegistry

extends Object
Class Inheritance
Imports
org.opentest4j.reporting.schema.Namespace, java.util.Collections, .LinkedHashMap, .Map, .Optional, .Set

Registry of namespaces for writing a document.
See Also
Namespace, DocumentWriter

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final Map<Namespace, String>
private final Namespace
private final Map<Namespace, String>
pack-priv static final String

Constructor Summary

AccessConstructor and Description
private
NamespaceRegistry(Namespace defaultNamespace, Map<Namespace, String> schemaLocations, Map<Namespace, String> additionalNamespaces)

Method Summary

Modifier and TypeMethod and Description
public static NamespaceRegistry.Builder

Returns:

a new builder
builder
(Namespace
the default namespace
defaultNamespace
)

Create a new builder with the supplied default namespace.

public static NamespaceRegistry.Builder

Returns:

a new builder
builder
(Namespace
the default namespace
defaultNamespace
,
String
the schema location of the default namespace
schemaLocation
)

Create a new builder with the supplied default namespace and schema location.

public boolean

Returns:

whether the namespace is registered
containsUri
(String
the namespace URI to look up
uri
)

Check whether a namespace with the supplied URI is registered with this registry.

public Set<Namespace>

Returns:

additional namespaces
getAdditionalNamespaces
()

Get additional namespaces registered with this registry.

public Namespace

Returns:

the default namespace
getDefaultNamespace
()

Get the default namespace of this registry.

public Optional<String>

Returns:

the prefix for the namespace or empty if the namespace is not as an additional namespace
getPrefix
(Namespace
the namespace to look up the prefix for
namespace
)

Get the prefix for the supplied namespace registered with this registry.

public Map<Namespace, String>

Returns:

schema locations
getSchemaLocations
()

Get all schema locations registered with this registry.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

additionalNamespacesback to summary
private final Map<Namespace, String> additionalNamespaces
defaultNamespaceback to summary
private final Namespace defaultNamespace
schemaLocationsback to summary
private final Map<Namespace, String> schemaLocations
XSI_PREFIXback to summary
pack-priv static final String XSI_PREFIX

Constructor Detail

NamespaceRegistryback to summary
private NamespaceRegistry(Namespace defaultNamespace, Map<Namespace, String> schemaLocations, Map<Namespace, String> additionalNamespaces)

Method Detail

builderback to summary
public static NamespaceRegistry.Builder builder(Namespace defaultNamespace)

Create a new builder with the supplied default namespace.

Parameters
defaultNamespace:Namespace

the default namespace

Returns:NamespaceRegistry.Builder

a new builder

builderback to summary
public static NamespaceRegistry.Builder builder(Namespace defaultNamespace, String schemaLocation)

Create a new builder with the supplied default namespace and schema location.

Parameters
defaultNamespace:Namespace

the default namespace

schemaLocation:String

the schema location of the default namespace

Returns:NamespaceRegistry.Builder

a new builder

containsUriback to summary
public boolean containsUri(String uri)

Check whether a namespace with the supplied URI is registered with this registry.

Parameters
uri:String

the namespace URI to look up

Returns:boolean

whether the namespace is registered

getAdditionalNamespacesback to summary
public Set<Namespace> getAdditionalNamespaces()

Get additional namespaces registered with this registry.

Returns:Set<Namespace>

additional namespaces

getDefaultNamespaceback to summary
public Namespace getDefaultNamespace()

Get the default namespace of this registry.

Returns:Namespace

the default namespace

getPrefixback to summary
public Optional<String> getPrefix(Namespace namespace)

Get the prefix for the supplied namespace registered with this registry.

Parameters
namespace:Namespace

the namespace to look up the prefix for

Returns:Optional<String>

the prefix for the namespace or empty if the namespace is not as an additional namespace

getSchemaLocationsback to summary
public Map<Namespace, String> getSchemaLocations()

Get all schema locations registered with this registry.

Returns:Map<Namespace, String>

schema locations

org.opentest4j.reporting.events.api back to summary

public Class NamespaceRegistry.Builder

extends Object
Class Inheritance
  • java.lang.Object
  • org.opentest4j.reporting.events.api.NamespaceRegistry.Builder

Builder for NamespaceRegistry.

Field Summary

Modifier and TypeField and Description
private final Map<Namespace, String>
private final Namespace
private final Map<Namespace, String>

Constructor Summary

AccessConstructor and Description
private
Builder(Namespace defaultNamespace, String schemaLocation)

Method Summary

Modifier and TypeMethod and Description
public NamespaceRegistry.Builder

Returns:

this builder
add
(String
the prefix for the namespace
prefix
,
Namespace
the namespace
namespace
)

Add an additional namespace to this registry.

public NamespaceRegistry.Builder

Returns:

this builder
add
(String
the prefix for the namespace
prefix
,
Namespace
the namespace
namespace
,
String
the schema location of the namespace
schemaLocation
)

Add an additional namespace to this registry.

public NamespaceRegistry

Returns:

the namespace registry
build
()

Build the NamespaceRegistry.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

additionalNamespacesback to summary
private final Map<Namespace, String> additionalNamespaces
defaultNamespaceback to summary
private final Namespace defaultNamespace
schemaLocationsback to summary
private final Map<Namespace, String> schemaLocations

Constructor Detail

Builderback to summary
private Builder(Namespace defaultNamespace, String schemaLocation)

Method Detail

addback to summary
public NamespaceRegistry.Builder add(String prefix, Namespace namespace)

Add an additional namespace to this registry.

Parameters
prefix:String

the prefix for the namespace

namespace:Namespace

the namespace

Returns:NamespaceRegistry.Builder

this builder

addback to summary
public NamespaceRegistry.Builder add(String prefix, Namespace namespace, String schemaLocation)

Add an additional namespace to this registry.

Parameters
prefix:String

the prefix for the namespace

namespace:Namespace

the namespace

schemaLocation:String

the schema location of the namespace

Returns:NamespaceRegistry.Builder

this builder

buildback to summary
public NamespaceRegistry build()

Build the NamespaceRegistry.

Returns:NamespaceRegistry

the namespace registry