public final class Errors extends Object implements Serializable
Errors can be chained to provide additional context. To add context, call withSource(java.lang.Object)
to create a new Errors instance that contains additional context. All messages added to the
returned instance will contain full context.
To avoid messages with redundant context, withSource(java.lang.Object)
should be added sparingly. A
good rule of thumb is to assume a method's caller has already specified enough context to
identify that method. When calling a method that's defined in a different context, call that
method with an errors object that includes its context.
public Errors()
public Errors(Object source)
public Errors withSource(Object source)
source
as a reference point for newly added errors.public Errors missingImplementation(Key key)
Guice.createInjector(new AbstractModule() {
public void configure() {
bind(Runnable.class);
}
}
...and at provide-time errors:
Guice.createInjector().getInstance(Runnable.class);
Otherwise we need to know who's calling when resolving a just-in-time binding, which makes
things unnecessarily complex.public Errors converterReturnedNull(String stringValue, Object source, TypeLiteral<?> type, TypeConverterBinding typeConverterBinding)
public Errors conversionTypeError(String stringValue, Object source, TypeLiteral<?> type, TypeConverterBinding typeConverterBinding, Object converted)
public Errors conversionError(String stringValue, Object source, TypeLiteral<?> type, TypeConverterBinding typeConverterBinding, RuntimeException cause)
public Errors ambiguousTypeConversion(String stringValue, Object source, TypeLiteral<?> type, TypeConverterBinding a, TypeConverterBinding b)
public Errors bindingToProvider()
public Errors recursiveImplementationType()
public Errors recursiveProviderType()
public Errors missingRuntimeRetention(Class<? extends Annotation> annotation)
public Errors missingScopeAnnotation(Class<? extends Annotation> annotation)
public Errors optionalConstructor(Constructor constructor)
public Errors scopeNotFound(Class<? extends Annotation> scopeAnnotation)
public Errors scopeAnnotationOnAbstractType(Class<? extends Annotation> scopeAnnotation, Class<?> type, Object source)
public Errors misplacedBindingAnnotation(Member member, Annotation bindingAnnotation)
public Errors missingConstructor(TypeLiteral<?> type)
public Errors constructorNotDefinedByType(Constructor<?> constructor, TypeLiteral<?> type)
public Errors duplicateScopes(ScopeBinding existing, Class<? extends Annotation> annotationType, Scope scope)
public Errors voidProviderMethod()
public Errors missingConstantValues()
public Errors duplicateBindingAnnotations(Member member, Class<? extends Annotation> a, Class<? extends Annotation> b)
public Errors cannotInjectMethodWithTypeParameters(Method method)
public Errors duplicateScopeAnnotations(Class<? extends Annotation> a, Class<? extends Annotation> b)
public Errors recursiveBinding()
public Errors errorCheckingDuplicateBinding(Key<?> key, Object source, Throwable t)
public Errors errorNotifyingTypeListener(TypeListenerBinding listener, TypeLiteral<?> type, Throwable cause)
public Errors keyNotFullySpecified(TypeLiteral<?> typeLiteral)
public static Collection<Message> getMessagesFromThrowable(Throwable throwable)
public Errors errorInUserCode(Throwable cause, String messageFormat, Object... arguments)
public Errors cannotInjectRawProvider()
public Errors cannotInjectRawMembersInjector()
public Errors cannotInjectRawTypeLiteral()
public void throwCreationExceptionIfErrorsExist()
public void throwConfigurationExceptionIfErrorsExist()
public void throwProvisionExceptionIfErrorsExist()
public Errors merge(Collection<Message> messages)
public Errors merge(InternalProvisionException ipe)
public void throwIfNewErrors(int expectedSize) throws ErrorsException
ErrorsException
public ErrorsException toException()
public boolean hasErrors()
public int size()
public static Object convert(Object o, ElementSource source)
Copyright © 2006–2020 Google, Inc.. All rights reserved.