001 /*****************************************************************************
002 * Copyright (c) PicoContainer Organization. All rights reserved. *
003 * ------------------------------------------------------------------------- *
004 * The software in this package is published under the terms of the BSD *
005 * style license a copy of which has been included with this distribution in *
006 * the LICENSE.txt file. *
007 * *
008 * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
009 *****************************************************************************/
010
011 package org.picocontainer.defaults;
012
013 import org.picocontainer.PicoRegistrationException;
014
015 /**
016 * A subclass of {@link PicoRegistrationException} that is thrown during component registration if the
017 * component's key is a type and the implementation is not assignable to.
018 *
019 * @author Paul Hammant
020 * @author Aslak Hellesøy
021 * @author Jon Tirsén
022 * @since 1.0
023 */
024 public class AssignabilityRegistrationException extends PicoRegistrationException {
025 /**
026 * Construct an exception with the type and the unassignable class.
027 *
028 * @param type the type used as component key
029 * @param clazz the unassignable implementation class
030 */
031 public AssignabilityRegistrationException(Class type, Class clazz) {
032 super("The type:" + type.getName() + " was not assignable from the class " + clazz.getName());
033 }
034 }