Search in sources :

Example 11 with ConstructionException

use of org.qi4j.api.common.ConstructionException in project qi4j-sdk by Qi4j.

the class Qi4jObjectFactory method createQi4jObject.

@SuppressWarnings("unchecked")
private Object createQi4jObject(Class aClass, boolean isAddToTypes) {
    if (objectFactory == null) {
        return null;
    }
    ConstructionException exception = null;
    Object obj = null;
    try {
        obj = objectFactory.newObject(aClass);
    } catch (NoSuchObjectException e) {
        return null;
    } catch (ConstructionException e) {
        exception = e;
    }
    if (isAddToTypes) {
        addToType(aClass, qi4jObject);
    }
    if (exception != null) {
        throw exception;
    }
    return obj;
}
Also used : NoSuchObjectException(org.qi4j.api.object.NoSuchObjectException) ConstructionException(org.qi4j.api.common.ConstructionException)

Aggregations

ConstructionException (org.qi4j.api.common.ConstructionException)11 InjectionContext (org.qi4j.runtime.injection.InjectionContext)3 InvocationHandler (java.lang.reflect.InvocationHandler)2 Initializable (org.qi4j.api.mixin.Initializable)2 InitializationException (org.qi4j.api.mixin.InitializationException)2 Method (java.lang.reflect.Method)1 List (java.util.List)1 Activator (org.qi4j.api.activation.Activator)1 Composite (org.qi4j.api.composite.Composite)1 CompositeInstance (org.qi4j.api.composite.CompositeInstance)1 InvalidCompositeException (org.qi4j.api.composite.InvalidCompositeException)1 NoSuchTransientException (org.qi4j.api.composite.NoSuchTransientException)1 NoSuchObjectException (org.qi4j.api.object.NoSuchObjectException)1 PropertyDescriptor (org.qi4j.api.property.PropertyDescriptor)1 EntityCompositeAlreadyExistsException (org.qi4j.api.unitofwork.EntityCompositeAlreadyExistsException)1 NoSuchValueException (org.qi4j.api.value.NoSuchValueException)1 ValueSerializationException (org.qi4j.api.value.ValueSerializationException)1 Iterables.toList (org.qi4j.functional.Iterables.toList)1 FragmentClassLoader (org.qi4j.runtime.composite.FragmentClassLoader)1 ValueModel (org.qi4j.runtime.value.ValueModel)1