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.xml;
10 import javax.xml.namespace.NamespaceContext;
11 import javax.xml.stream.XMLStreamException;
12 import javax.xml.stream.XMLStreamWriter;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
16 final class NullXmlCodec implements XmlCodec<Object> {
17 static final NullXmlCodec INSTANCE = new NullXmlCodec();
18 private static final Logger LOG = LoggerFactory.getLogger(NullXmlCodec.class);
20 private NullXmlCodec() {
25 public Class<Object> getDataClass() {
30 public void serializeToWriter(final XMLStreamWriter writer, final Object value) throws XMLStreamException {
31 // NOOP since codec is unkwown.
32 LOG.warn("Call of the serializeToWriter method on null codec. No operation performed.");
36 public Object deserializeFromString(final NamespaceContext namespaceContext, final String value) {
37 LOG.warn("Call of the deserializeString method on null codec. No operation performed.");