Examples of throwConfigurationExceptionIfErrorsExist()


Examples of com.google.inject.internal.Errors.throwConfigurationExceptionIfErrorsExist()

  /** Returns the binding for {@code key} */
  public <T> BindingImpl<T> getBinding(Key<T> key) {
    Errors errors = new Errors(key);
    try {
      BindingImpl<T> result = getBindingOrThrow(key, errors);
      errors.throwConfigurationExceptionIfErrorsExist();
      return result;
    } catch (ErrorsException e) {
      throw new ConfigurationException(errors.merge(e.getErrors()).getMessages());
    }
  }
View Full Code Here

Examples of com.google.inject.internal.Errors.throwConfigurationExceptionIfErrorsExist()

        List<FrameworkMethod> result = new ArrayList<FrameworkMethod>(testMethods.size());
        for (FrameworkMethod method : testMethods) {
            Method javaMethod = method.getMethod();
            Errors errors = new Errors(javaMethod);
            List<Key<?>> keys = GuiceUtils.getMethodKeys(javaMethod, errors);
            errors.throwConfigurationExceptionIfErrorsExist();

            List<List<Binding<?>>> bindingsToUseForParameters = new ArrayList<List<Binding<?>>>();
            for (Key<?> key : keys) {
                if (All.class.equals(key.getAnnotationType())) {
                    All allAnnotation = (All) key.getAnnotation();
View Full Code Here

Examples of com.google.inject.internal.Errors.throwConfigurationExceptionIfErrorsExist()

                        if (!All.class.equals(key.getAnnotationType())) {
                            Key<?> keyNeeded = GuiceUtils.ensureProvidedKey(key, errors);
                            addNeededKey(keysObserved, keysNeeded, keyNeeded, true);
                        }
                    }
                    errors.throwConfigurationExceptionIfErrorsExist();
                }
            }
            currentClass = currentClass.getSuperclass();
        }
View Full Code Here

Examples of com.google.inject.internal.Errors.throwConfigurationExceptionIfErrorsExist()

                for (Dependency<?> dependency : dependencies) {
                    Key<?> keyNeeded = GuiceUtils.ensureProvidedKey(dependency.getKey(),
                            errors);
                    addNeededKey(keysObserved, keysNeeded, keyNeeded, true);
                }
                errors.throwConfigurationExceptionIfErrorsExist();
            }
        }

        // Recursively add the dependencies of all the bindings observed. Warning, we can't use for each here
        // since it would result into concurrency issues.
View Full Code Here

Examples of com.google.inject.internal.Errors.throwConfigurationExceptionIfErrorsExist()

            methodInjector = Guice.createInjector(jukitoModule);
        }

        Errors errors = new Errors(javaMethod);
        List<Key<?>> keys = GuiceUtils.getMethodKeys(javaMethod, errors);
        errors.throwConfigurationExceptionIfErrorsExist();

        Iterator<Binding<?>> bindingIter;
        if (InjectedFrameworkMethod.class.isAssignableFrom(method.getClass())) {
            bindingIter = ((InjectedFrameworkMethod) method).getBindingsToUseForParameters().iterator();
        } else {
View Full Code Here

Examples of com.google.inject.internal.Errors.throwConfigurationExceptionIfErrorsExist()

    }
    catch (ErrorsException localErrorsException)
    {
      localErrors.merge(localErrorsException.getErrors());
    }
    localErrors.throwConfigurationExceptionIfErrorsExist();
    this.dependencies = $ImmutableList.of(newDependency(localKey, Nullability.allowsNull(arrayOfAnnotation), -1));
  }

  private $ImmutableList forMember(Member paramMember, TypeLiteral paramTypeLiteral, Annotation[][] paramArrayOfAnnotation)
  {
View Full Code Here

Examples of org.elasticsearch.common.inject.internal.Errors.throwConfigurationExceptionIfErrorsExist()

        try {
            key = Annotations.getKey(type.getFieldType(field), field, annotations, errors);
        } catch (ErrorsException e) {
            errors.merge(e.getErrors());
        }
        errors.throwConfigurationExceptionIfErrorsExist();

        this.dependencies = ImmutableList.<Dependency<?>>of(
                newDependency(key, Nullability.allowsNull(annotations), -1));
    }
View Full Code Here

Examples of org.elasticsearch.common.inject.internal.Errors.throwConfigurationExceptionIfErrorsExist()

            } catch (ErrorsException e) {
                errors.merge(e.getErrors());
            }
        }

        errors.throwConfigurationExceptionIfErrorsExist();
        return ImmutableList.copyOf(dependencies);
    }

    // This metohd is necessary to create a Dependency<T> with proper generic type information
    private <T> Dependency<T> newDependency(Key<T> key, boolean allowsNull, int parameterIndex) {
View Full Code Here

Examples of org.elasticsearch.common.inject.internal.Errors.throwConfigurationExceptionIfErrorsExist()

                injectableConstructor = constructor;
                checkForMisplacedBindingAnnotations(injectableConstructor, errors);
            }
        }

        errors.throwConfigurationExceptionIfErrorsExist();

        if (injectableConstructor != null) {
            return new InjectionPoint(type, injectableConstructor);
        }
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.