Package com.google.inject.internal
Class MissingConstructorError
java.lang.Object
com.google.inject.spi.ErrorDetail<T>
com.google.inject.internal.InternalErrorDetail<MissingConstructorError>
com.google.inject.internal.MissingConstructorError
- All Implemented Interfaces:
Serializable
Error reported when Guice can't find an useable constructor to create objects.
-
Field Summary
FieldsFields inherited from class com.google.inject.internal.InternalErrorDetail
errorId
-
Constructor Summary
ConstructorsConstructorDescriptionMissingConstructorError
(TypeLiteral<?> type, boolean atInjectRequired, List<Object> sources) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
formatDetail
(List<ErrorDetail<?>> mergeableErrors, Formatter formatter) Formats the detail of this error message along with other errors that are mergeable with this error.boolean
isMergeable
(ErrorDetail<?> other) Returns true if this error can be merged with theotherError
and formatted together.withSources
(List<Object> newSources) Returns a new instance of the sameErrorDetail
with updated sources.Methods inherited from class com.google.inject.internal.InternalErrorDetail
getErrorIdentifier, getLearnMoreLink
Methods inherited from class com.google.inject.spi.ErrorDetail
equals, format, getCause, getMessage, getSources, hashCode
-
Field Details
-
type
-
atInjectRequired
private final boolean atInjectRequired
-
-
Constructor Details
-
MissingConstructorError
MissingConstructorError(TypeLiteral<?> type, boolean atInjectRequired, List<Object> sources)
-
-
Method Details
-
isMergeable
Description copied from class:ErrorDetail
Returns true if this error can be merged with theotherError
and formatted together.By default this return false and implementations that support merging with other errors should override this method.
- Overrides:
isMergeable
in classErrorDetail<MissingConstructorError>
-
formatDetail
Description copied from class:ErrorDetail
Formats the detail of this error message along with other errors that are mergeable with this error. This is called fromErrorDetail.format(int, java.util.List<com.google.inject.spi.ErrorDetail<?>>, java.util.Formatter)
.mergeableErrors
is a list that contains all other errors that are reported in the same exception that are considered to be mergable with this error base on result of callingErrorDetail.isMergeable(com.google.inject.spi.ErrorDetail<?>)
. The list will be empty if non of the other errors are mergable with this error.- Specified by:
formatDetail
in classErrorDetail<MissingConstructorError>
- Parameters:
mergeableErrors
- list of errors that are mergeable with this errorformatter
- for printing the error message
-
withSources
Description copied from class:ErrorDetail
Returns a new instance of the sameErrorDetail
with updated sources.- Specified by:
withSources
in classErrorDetail<MissingConstructorError>
-