org.qi4j.api.composite
Class AmbiguousTypeException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.qi4j.api.mixin.MixinMappingException
                  extended by org.qi4j.api.composite.AmbiguousTypeException
All Implemented Interfaces:
Serializable

public class AmbiguousTypeException
extends MixinMappingException

This Exception is thrown when more than one Composite implements a MixinType that one tries to use to create a Composite instance from.

For instance;

 public interface AbcComposite extends TransientComposite, Abc
 {}

 public interface DefComposite extends TransientComposite, Def
 {}

 public interface Abc
 {}

 public interface Def extends Abc
 {}


 TransientBuilder cb = factory.newTransientBuilder( Abc.class );
 

In the code above, both the AbcComposite and DefComposite implement Abc, and therefore the newTransientBuilder method can not unambiguously figure out which one is intended.

See Also:
Serialized Form

Constructor Summary
AmbiguousTypeException(Class<?> mixinType, Class<?>... matchingTypes)
           
AmbiguousTypeException(Class<?> mixinType, Iterable<Class<?>> matchingTypes)
           
 
Method Summary
 Iterable<Class<?>> matchingTypes()
           
 Class<?> mixinType()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AmbiguousTypeException

public AmbiguousTypeException(Class<?> mixinType,
                              Class<?>... matchingTypes)

AmbiguousTypeException

public AmbiguousTypeException(Class<?> mixinType,
                              Iterable<Class<?>> matchingTypes)
Method Detail

mixinType

public Class<?> mixinType()

matchingTypes

public Iterable<Class<?>> matchingTypes()