Package com.google.inject

Examples of com.google.inject.ConfigurationException


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


        Key<?> providedKey = (Key<?>)getProvidedKey((Key)key, new Errors());
        if(getExistingBinding(providedKey) != null) {
          return getBinding(key);
        }
      } catch(ErrorsException e) {
        throw new ConfigurationException(e.getErrors().getMessages());
      }
    }

    // No existing binding exists.
    return null;
View Full Code Here

  public <T> MembersInjector<T> getMembersInjector(TypeLiteral<T> typeLiteral) {
    Errors errors = new Errors(typeLiteral);
    try {
      return membersInjectorStore.get(typeLiteral, errors);
    } catch (ErrorsException e) {
      throw new ConfigurationException(errors.merge(e.getErrors()).getMessages());
    }
  }
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());
    }
  }
View Full Code Here

                = new ImmutableList.Builder<Message>()
                .addAll(errors)
                .addAll(warnings)
                .build();

        return new ConfigurationException(messages);
    }
View Full Code Here

                = new ImmutableList.Builder<Message>()
                .addAll(errors)
                .addAll(warnings)
                .build();

        return new ConfigurationException(messages);
    }
View Full Code Here

   static void checkConfiguration(boolean condition, String format, Object... args) {
      if (condition) {
         return;
      }

      throw new ConfigurationException(ImmutableSet.of(new Message(String.format(format, args))));
   }
View Full Code Here

      if (reference != null) {
         return reference;
      }

      NullPointerException npe = new NullPointerException(name);
      throw new ConfigurationException(ImmutableSet.of(new Message(ImmutableList.of(), npe.toString(), npe)));
   }
View Full Code Here

  {
    Type localType = paramTypeLiteral.getType();
    if (!isFullySpecified(localType))
    {
      localObject = new Errors().keyNotFullySpecified(paramTypeLiteral);
      throw new ConfigurationException(((Errors)localObject).getMessages());
    }
    if (paramTypeLiteral.getRawType() == Provider.class)
    {
      localObject = (ParameterizedType)localType;
      TypeLiteral localTypeLiteral = TypeLiteral.get(Types.providerOf(localObject.getActualTypeArguments()[0]));
View Full Code Here

      localErrors.throwConfigurationExceptionIfErrorsExist();
      return localBindingImpl;
    }
    catch (ErrorsException localErrorsException)
    {
      throw new ConfigurationException(localErrors.merge(localErrorsException.getErrors()).getMessages());
    }
  }
View Full Code Here

TOP

Related Classes of com.google.inject.ConfigurationException

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.