Package com.google.inject.internal

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


              context.setDependency(dependency);
              Errors errorsForBinding = errors.withSource(dependency);
              try {
                binding.getInternalFactory().get(errorsForBinding, context, dependency);
              } catch (ErrorsException e) {
                errorsForBinding.merge(e.getErrors());
              } finally {
                context.setDependency(null);
              }

              return null;
View Full Code Here


    try {
      BindingImpl<T> result = getBindingOrThrow(key, errors);
      errors.throwConfigurationExceptionIfErrorsExist();
      return result;
    } catch (ErrorsException e) {
      throw new ConfigurationException(errors.merge(e.getErrors()).getMessages());
    }
  }

  /**
   * Gets a binding implementation.  First, it check to see if the parent has a binding.  If the
View Full Code Here

    // configuration/validation stuff throws ConfigurationException
    List<SingleMemberInjector> injectors;
    try {
      injectors = this.injectors.get(TypeLiteral.get(o.getClass()), errors);
    } catch (ErrorsException e) {
      throw new ConfigurationException(errors.merge(e.getErrors()).getMessages());
    }

    // injection can throw ProvisionException
    try {
      injectMembersOrThrow(errors, o, injectors);
View Full Code Here

    // injection can throw ProvisionException
    try {
      injectMembersOrThrow(errors, o, injectors);
    } catch (ErrorsException e) {
      errors.merge(e.getErrors());
    }

    errors.throwProvisionExceptionIfErrorsExist();
  }
View Full Code Here

            }
          });
          errors.throwIfNewErrors(0);
          return t;
        } catch (ErrorsException e) {
          throw new ProvisionException(errors.merge(e.getErrors()).getMessages());
        }
      }

      @Override public String toString() {
        return factory.toString();
View Full Code Here

    try {
      Provider<T> result = getProviderOrThrow(key, errors);
      errors.throwIfNewErrors(0);
      return result;
    } catch (ErrorsException e) {
      throw new ConfigurationException(errors.merge(e.getErrors()).getMessages());
    }
  }

  public <T> T getInstance(Key<T> key) {
    return getProvider(key).get();
View Full Code Here

    {
      localKey = Annotations.getKey(paramTypeLiteral.getFieldType(paramField), paramField, arrayOfAnnotation, localErrors);
    }
    catch (ConfigurationException localConfigurationException)
    {
      localErrors.merge(localConfigurationException.getErrorMessages());
    }
    catch (ErrorsException localErrorsException)
    {
      localErrors.merge(localErrorsException.getErrors());
    }
View Full Code Here

    {
      localErrors.merge(localConfigurationException.getErrorMessages());
    }
    catch (ErrorsException localErrorsException)
    {
      localErrors.merge(localErrorsException.getErrors());
    }
    localErrors.throwConfigurationExceptionIfErrorsExist();
    this.dependencies = $ImmutableList.of(newDependency(localKey, Nullability.allowsNull(arrayOfAnnotation), -1));
  }
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.