package org.opendaylight.yangtools.yang.common;
import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkState;
-import static java.util.Objects.requireNonNull;
import com.google.common.annotations.Beta;
import java.io.Serializable;
* statements and detailed in <a href="https://tools.ietf.org/html/rfc7950#section-7.1.4">RFC7950 Section 7.1.4</a>.
*
* <p>
- * Each namespace context can have a default namespace and a set of prefix/namespace mappings. A namespace can be bound
- * to multiple prefixes at the same time. The default namespace must also have a prefix assigned.
+ * Each namespace context has a set of prefix/namespace mappings. A namespace can be bound to multiple prefixes at the
+ * same time.
*
* @author Robert Varga
*/
@Beta
public interface YangNamespaceContext extends Immutable, Serializable {
-
-
-
- /**
- * Return the default namespace in this context.
- *
- * @return Default namespace, if supported.
- */
- @NonNull Optional<QNameModule> getDefaultNamespace();
-
/**
* Return QNameModule to which a particular prefix is bound.
*
*/
@NonNull Optional<String> findPrefixForNamespace(QNameModule namespace);
- /**
- * Create a {@link QName} in the default namespace.
- *
- * @param localName QName local name
- * @return A QName.
- * @throws NullPointerException if {@code localName} is null
- * @throws IllegalArgumentException if {@code localName} does not conform to local name requirements
- * @throws IllegalStateException if this context does not have default namespace
- */
- default @NonNull QName createQName(final String localName) {
- final Optional<QNameModule> namespace = getDefaultNamespace();
- checkState(namespace.isPresent(), "%s does not have a default namespace", this);
- return QName.create(namespace.get(), requireNonNull(localName));
- }
-
/**
* Create a {@link QName} by resolving a prefix against currently-bound prefixes and combining it with specified
* local name.