public Errors missingRuntimeRetention(Class<? extends Annotation> annotation) { return addMessage(format("Please annotate %s with @Retention(RUNTIME).", annotation)); }
public Errors missingScopeAnnotation(Class<? extends Annotation> annotation) { return addMessage(format("Please annotate %s with @ScopeAnnotation.", annotation)); }
@Override public void addError(String message, Object... arguments) { elements.add(new Message(getElementSource(), Errors.format(message, arguments))); }
/** * Throws a ConfigurationException with a formatted {@link Message} if this condition is {@code * false}. */ static void checkConfiguration(boolean condition, String format, Object... args) { if (condition) { return; } throw new ConfigurationException(ImmutableSet.of(new Message(Errors.format(format, args)))); }
StringBuilder sb = new StringBuilder(); sb.append(format("No implementation for %s was bound.", key)); List<Binding<T>> sameTypes = injector.findBindingsByType(type); if (!sameTypes.isEmpty()) { sb.append(format("%n Did you mean?")); int howMany = Math.min(sameTypes.size(), MAX_MATCHING_TYPES_REPORTED); for (int i = 0; i < howMany; ++i) { sb.append(format("%n * %s", sameTypes.get(i).getKey())); sb.append(format("%n %d more binding%s with other annotations.", remaining, plural)); sb.append(format("%n Did you mean?")); for (String possibleMatch : possibleMatches) { sb.append(format("%n %s", possibleMatch)); && COMMON_AMBIGUOUS_TYPES.contains(key.getTypeLiteral().getRawType())) { sb.append(format("%nThe key seems very generic, did you forget an annotation?"));
Errors.format("%nFound these Bindings that were missing an associated entry:%n")); for (Key<V> key : keysOnlyFromBindings) { sb.append( Errors.format(" %s bound at: %s%n", key, valueKeyToBinding.get(key).getSource())); sb.append(Errors.format("%nFound these map keys without a corresponding value:%n")); for (Key<V> key : keysOnlyFromProviderMapEntrys) { sb.append( Errors.format( " '%s' bound at: %s%n", valueKeyToKey.get(key), valueKeyToEntryBinding.get(key).getSource()));
@Override public String getMessage() { return Errors.format("Unable to create injector, see the following errors", messages); } }
@Override public String getMessage() { return Errors.format("Unable to provision, see the following errors", messages); } }
@Override public String getMessage() { return Errors.format("Guice configuration errors", messages); } }
@Override public void addError(String message, Object... arguments) { elements.add(new Message(getElementSource(), Errors.format(message, arguments))); }
@Override public void addError(String message, Object... arguments) { elements.add(new Message(getElementSource(), Errors.format(message, arguments))); }
/** * Throws a ConfigurationException with a formatted {@link Message} if this condition is {@code * false}. */ static void checkConfiguration(boolean condition, String format, Object... args) { if (condition) { return; } throw new ConfigurationException(ImmutableSet.of(new Message(Errors.format(format, args)))); }
/** * Throws a ConfigurationException with a formatted {@link Message} if this condition is {@code * false}. */ static void checkConfiguration(boolean condition, String format, Object... args) { if (condition) { return; } throw new ConfigurationException(ImmutableSet.of(new Message(Errors.format(format, args)))); }
private static ConfigurationException newConfigurationException(String format, Object... args) { return new ConfigurationException(ImmutableSet.of(new Message(Errors.format(format, args)))); } }
static void checkConfiguration(boolean condition, String format, Object... args) { if (condition) { return; } throw new ConfigurationException(ImmutableSet.of(new Message(Errors.format(format, args)))); }
private static ConfigurationException newConfigurationException(String format, Object... args) { return new ConfigurationException(ImmutableSet.of(new Message(Errors.format(format, args)))); } }
private static ConfigurationException newConfigurationException(String format, Object... args) { return new ConfigurationException(ImmutableSet.of(new Message(Errors.format(format, args)))); } }
private Errors addMessage(Throwable cause, String messageFormat, Object... arguments) { String message = format(messageFormat, arguments); addMessage(new Message(getSources(), message, cause)); return this; }
private Errors addMessage(Throwable cause, String messageFormat, Object... arguments) { String message = format(messageFormat, arguments); addMessage(new Message(getSources(), message, cause)); return this; }
static void checkConfiguration(boolean condition, String format, Object... args) { if (condition) { return; } throw new ConfigurationException(ImmutableSet.of(new Message(Errors.format(format, args)))); }