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.impl.codec.xml;
10 import javax.annotation.Nonnull;
11 import org.opendaylight.yangtools.yang.data.impl.codec.TypeDefinitionAwareCodec;
12 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
15 * Common XML-related utility methods, which are not specific to a particular
18 public final class XmlUtils {
19 public static final XmlCodecProvider DEFAULT_XML_CODEC_PROVIDER = new XmlCodecProvider() {
21 public TypeDefinitionAwareCodec<Object, ? extends TypeDefinition<?>> codecFor(final TypeDefinition<?> baseType) {
22 return TypeDefinitionAwareCodec.from(baseType);
27 throw new UnsupportedOperationException();
31 * @deprecated This utility method is no longer needed: check type identity directly
34 public static TypeDefinition<?> resolveBaseTypeFrom(final @Nonnull TypeDefinition<?> type) {
35 TypeDefinition<?> superType = type;
36 while (superType.getBaseType() != null) {
37 superType = superType.getBaseType();