2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.data.codec.gson;
10 import static java.util.Objects.requireNonNull;
13 import javax.annotation.Nonnull;
14 import org.opendaylight.yangtools.yang.common.QName;
17 * Abstract base class for {@link JSONNormalizedNodeStreamWriter} recursion
18 * levels which emit a QName-identified node.
20 abstract class JSONStreamWriterQNameContext extends JSONStreamWriterContext {
21 private final QName qname;
23 JSONStreamWriterQNameContext(final JSONStreamWriterContext parent, final QName qname, final boolean mandatory) {
24 super(parent, mandatory);
25 this.qname = requireNonNull(qname);
29 * Returns the node's identifier as a QName.
31 * @return QName identifier
33 protected final QName getQName() {
39 protected final URI getNamespace() {
40 return qname.getNamespace();