Merge branch 'master' of ../controller
[yangtools.git] / yang / yang-data-codec-gson / src / main / java / org / opendaylight / yangtools / yang / data / codec / gson / JSONStreamWriterExclusiveRootContext.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.data.codec.gson;
9
10 import com.google.gson.stream.JsonWriter;
11 import java.io.IOException;
12 import java.net.URI;
13 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
14
15 final class JSONStreamWriterExclusiveRootContext extends JSONStreamWriterRootContext {
16     JSONStreamWriterExclusiveRootContext(final URI namespace) {
17         super(namespace, true);
18     }
19
20     @Override
21     protected void emitStart(final SchemaContext schema, final JsonWriter writer) throws IOException {
22         writer.beginObject();
23     }
24
25     @Override
26     protected void emitEnd(final JsonWriter writer) throws IOException {
27         writer.endObject();
28     }
29 }