Examples of ConstructionException


Examples of org.qi4j.api.common.ConstructionException

        {
            if( e.getTargetException() instanceof InvalidCompositeException )
            {
                throw (InvalidCompositeException) e.getTargetException();
            }
            throw new ConstructionException( "Could not instantiate " + constructor.getDeclaringClass(), e.getTargetException() );
        }
        catch( Throwable e )
        {
            System.err.println( constructor.toGenericString() );
            System.err.println( Arrays.asList( parametersInstance ) );
            throw new ConstructionException( "Could not instantiate " + constructor.getDeclaringClass(), e );
        }
    }
View Full Code Here

Examples of org.qi4j.api.common.ConstructionException

    }

    public Object newInstance( InjectionContext injectionContext )
    {
        // Try all bound constructors, in order
        ConstructionException exception = null;
        for( ConstructorModel constructorModel : boundConstructors )
        {
            try
            {
                return constructorModel.newInstance( injectionContext );
View Full Code Here

Examples of org.qi4j.api.common.ConstructionException

        try
        {
            return (T) new JSONDeserializer( model.module() ).deserialize( new JSONTokener( jsonValue ).nextValue(), model.model().valueType() );
        } catch( JSONException e )
        {
            throw new ConstructionException( "Could not create value from JSON", e );
        }
    }
View Full Code Here

Examples of org.qi4j.api.common.ConstructionException

            Constraint<?, ?> constraint = new CompositeConstraintInstance( compositeConstraintsInstance );
            return new ConstraintInstance( constraint, annotation );
        }
        catch( Exception e )
        {
            throw new ConstructionException( "Could not instantiate constraint implementation", e );
        }
    }
View Full Code Here

Examples of org.qi4j.api.common.ConstructionException

            Constraint<?, ?> constraint = constraintClass.newInstance();
            return new ConstraintInstance( constraint, annotation );
        }
        catch( Exception e )
        {
            throw new ConstructionException( "Could not instantiate constraint implementation", e );
        }
    }
View Full Code Here

Examples of org.qi4j.api.common.ConstructionException

            injectedFieldsModel.inject( injectionContext, instance );
            injectedMethodsModel.inject( injectionContext, instance );
        }
        catch( Exception e )
        {
            throw new ConstructionException( "Could not instantiate " + objectType.getName(), e );
        }

        if( instance instanceof Initializable )
        {
            try
            {
                ( (Initializable) instance ).initialize();
            }
            catch( InitializationException e )
            {
                throw new ConstructionException( "Unable to initialize " + objectType, e );
            }
        }

        return instance;
    }
View Full Code Here

Examples of org.qi4j.api.common.ConstructionException

                    instantiationClass = fragmentLoader.loadFragmentClass( fragmentClass );
                    instantiationClasses.put( fragmentClass, instantiationClass );
                }
                catch( ClassNotFoundException | VerifyError e )
                {
                    throw new ConstructionException( "Could not generate mixin subclass " + fragmentClass.getName(), e );
                }
            }
        }
        return instantiationClass;
    }
View Full Code Here

Examples of org.qi4j.api.common.ConstructionException

                    {
                        filter = (AppliesToFilter) appliesToClass.newInstance();
                    }
                    catch( Exception e )
                    {
                        throw new ConstructionException( e );
                    }
                }
                else if( Annotation.class.isAssignableFrom( appliesToClass ) )
                {
                    filter = new AnnotationAppliesToFilter( appliesToClass );
View Full Code Here

Examples of org.qi4j.api.common.ConstructionException

            {
                String message =
                    "[Module " + resolution.module()
                        .name() + "] Non-optional @" + rawInjectionClass.getName() + " was not bound in " + injectedClass
                        .getName();
                throw new ConstructionException( message );
            }
        }
        catch( InvalidInjectionException e )
        {
            throw new BindingException( "Could not bind dependency injection", e );
View Full Code Here

Examples of org.qi4j.api.common.ConstructionException

            }

            String message = "[Module " + context.module()
                .name() + "] InjectionProvider unable to resolve @" + injectionAnnotation.annotationType()
                .getSimpleName() + " " + injectionType.toString();
            throw new ConstructionException( message, ex );
        }
        if( injectedValue == null && !optional )
        {
            String message = "[Module " + context.module()
                .name() + "] Non-optional @" + injectionAnnotation.annotationType()
                .getSimpleName() + " " + injectionType.toString() + " was null in " + injectedClass.getName();
            throw new ConstructionException( message );
        }
        return getInjectedValue( injectedValue );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.