2 * Copyright (c) 2015 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.binding.data.codec.impl;
10 import org.opendaylight.yangtools.sal.binding.generator.api.ClassLoadingStrategy;
14 * Thrown when user schema for supplied binding class is available in present schema context, but
15 * binding class itself is not known to codecs because backing class loading strategy did not
19 public class MissingClassInLoadingStrategyException extends MissingSchemaException {
21 private static final long serialVersionUID = 1L;
23 protected MissingClassInLoadingStrategyException(final String msg, final Throwable cause) {
27 public static void check(final ClassLoadingStrategy strategy, final Class<?> childClass) {
29 strategy.loadClass(childClass.getName());
30 } catch (final ClassNotFoundException e) {
31 final String message =
32 String.format("User supplied class %s is not available in %s.", childClass.getName(), strategy);
33 throw new MissingClassInLoadingStrategyException(message, e);