Package org.elasticsearch.common.inject.internal

Examples of org.elasticsearch.common.inject.internal.Errors


    public ImmutableList<SingleMemberInjector> getMemberInjectors() {
        return memberInjectors;
    }

    public void injectMembers(T instance) {
        Errors errors = new Errors(typeLiteral);
        try {
            injectAndNotify(instance, errors);
        } catch (ErrorsException e) {
            errors.merge(e.getErrors());
        }

        errors.throwProvisionExceptionIfErrorsExist();
    }
View Full Code Here


    ImmutableList<SingleMemberInjector> getInjectors(
            Set<InjectionPoint> injectionPoints, Errors errors) {
        List<SingleMemberInjector> injectors = Lists.newArrayList();
        for (InjectionPoint injectionPoint : injectionPoints) {
            try {
                Errors errorsForMember = injectionPoint.isOptional()
                        ? new Errors(injectionPoint)
                        : errors.withSource(injectionPoint);
                SingleMemberInjector injector = injectionPoint.getMember() instanceof Field
                        ? new SingleFieldInjector(this.injector, injectionPoint, errorsForMember)
                        : new SingleMethodInjector(this.injector, injectionPoint, errorsForMember);
                injectors.add(injector);
View Full Code Here

    public ImmutableList<SingleMemberInjector> getMemberInjectors() {
        return memberInjectors;
    }

    public void injectMembers(T instance) {
        Errors errors = new Errors(typeLiteral);
        try {
            injectAndNotify(instance, errors);
        } catch (ErrorsException e) {
            errors.merge(e.getErrors());
        }

        errors.throwProvisionExceptionIfErrorsExist();
    }
View Full Code Here

    ImmutableList<SingleMemberInjector> getInjectors(
            Set<InjectionPoint> injectionPoints, Errors errors) {
        List<SingleMemberInjector> injectors = Lists.newArrayList();
        for (InjectionPoint injectionPoint : injectionPoints) {
            try {
                Errors errorsForMember = injectionPoint.isOptional()
                        ? new Errors(injectionPoint)
                        : errors.withSource(injectionPoint);
                SingleMemberInjector injector = injectionPoint.getMember() instanceof Field
                        ? new SingleFieldInjector(this.injector, injectionPoint, errorsForMember)
                        : new SingleMethodInjector(this.injector, injectionPoint, errorsForMember);
                injectors.add(injector);
View Full Code Here

        this.injector = injector;
        this.internalFactory = internalFactory;
    }

    public T get() {
        final Errors errors = new Errors();
        try {
            T t = injector.callInContext(new ContextualCallable<T>() {
                public T call(InternalContext context) throws ErrorsException {
                    Dependency dependency = context.getDependency();
                    return internalFactory.get(errors, context, dependency);
                }
            });
            errors.throwIfNewErrors(0);
            return t;
        } catch (ErrorsException e) {
            throw new ProvisionException(errors.merge(e.getErrors()).getMessages());
        }
    }
View Full Code Here

     *                     methods.
     */
    FactoryProvider2(TypeLiteral<F> factoryType, Key<?> producedType) {
        this.producedType = producedType;

        Errors errors = new Errors();

        @SuppressWarnings("unchecked") // we imprecisely treat the class literal of T as a Class<T>
                Class<F> factoryRawType = (Class) factoryType.getRawType();

        try {
View Full Code Here

            this.source = request.getSource();
            this.request = request;
        }

        void validate() {
            Errors errorsForMember = errors.withSource(source);
            Set<InjectionPoint> injectionPoints;
            try {
                injectionPoints = request.getInjectionPoints();
            } catch (ConfigurationException e) {
                errors.merge(e.getErrorMessages());
View Full Code Here

            process(injectorShell.getInjector(), injectorShell.getElements());
        }
    }

    public void process(InjectorImpl injector, List<Element> elements) {
        Errors errorsAnyElement = this.errors;
        this.injector = injector;
        try {
            for (Iterator<Element> i = elements.iterator(); i.hasNext(); ) {
                Element element = i.next();
                this.errors = errorsAnyElement.withSource(element.getSource());
                Boolean allDone = element.acceptVisitor(this);
                if (allDone) {
                    i.remove();
                }
            }
View Full Code Here

TOP

Related Classes of org.elasticsearch.common.inject.internal.Errors

Copyright © 2018 www.massapicom. 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.