Bug 5019: Add QName param to NormalizedNodeWriter#leafSetEntryNode
[yangtools.git] / yang / yang-data-codec-gson / src / main / java / org / opendaylight / yangtools / yang / data / codec / gson / JSONEmptyCodec.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
9 package org.opendaylight.yangtools.yang.data.codec.gson;
10
11 import com.google.gson.stream.JsonWriter;
12 import java.io.IOException;
13
14 final class JSONEmptyCodec implements JSONCodec<Object> {
15
16     static final JSONEmptyCodec INSTANCE = new JSONEmptyCodec();
17
18     private JSONEmptyCodec() {
19
20     }
21
22     @Override
23     public Object deserialize(final String input) {
24         return null;
25     }
26
27     @Override
28     public String serialize(final Object input) {
29         return null;
30     }
31
32     @Override
33     public boolean needQuotes() {
34         return false;
35     }
36
37     @Override
38     public void serializeToWriter(final JsonWriter writer, final Object value) throws IOException {
39         writer.beginArray();
40         writer.value((String) null);
41         writer.endArray();
42     }
43
44 }