2 * Copyright (c) 2017 Pantheon Technologies, s.r.o. 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 com.google.gson.stream.JsonWriter;
11 import java.io.IOException;
12 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory;
15 final class NullJSONCodec implements JSONCodec<Object> {
16 static final NullJSONCodec INSTANCE = new NullJSONCodec();
17 private static final Logger LOG = LoggerFactory.getLogger(NullJSONCodec.class);
19 private NullJSONCodec() {
24 public Class<Object> getDataType() {
29 public Object parseValue(final Object ctx, final String str) {
30 LOG.warn("Call of the deserializeString method on null codec. No operation performed.");
35 public void writeValue(final JsonWriter ctx, final Object value) throws IOException {
36 // NOOP since codec is unknown.
37 LOG.warn("Call of the serializeToWriter method on null codec. No operation performed.");