Package com.google.inject
Class ConfigurationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.google.inject.ConfigurationException
-
- All Implemented Interfaces:
java.io.Serializable
public final class ConfigurationException extends java.lang.RuntimeException
Thrown when a programming error such as a misplaced annotation, illegal binding, or unsupported scope is found. Clients should catch this exception, log it, and stop execution.- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableSet<Message>
messages
private java.lang.Object
partialValue
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description ConfigurationException(java.lang.Iterable<Message> messages)
Creates a ConfigurationException containingmessages
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<Message>
getErrorMessages()
Returns messages for the errors that caused this exception.java.lang.String
getMessage()
<E> E
getPartialValue()
Returns a value that was only partially computed due to this exception.ConfigurationException
withPartialValue(java.lang.Object partialValue)
Returns a copy of this configuration exception with the specified partial value.
-
-
-
Field Detail
-
messages
private final com.google.common.collect.ImmutableSet<Message> messages
-
partialValue
private java.lang.Object partialValue
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConfigurationException
public ConfigurationException(java.lang.Iterable<Message> messages)
Creates a ConfigurationException containingmessages
.
-
-
Method Detail
-
withPartialValue
public ConfigurationException withPartialValue(java.lang.Object partialValue)
Returns a copy of this configuration exception with the specified partial value.
-
getErrorMessages
public java.util.Collection<Message> getErrorMessages()
Returns messages for the errors that caused this exception.
-
getPartialValue
public <E> E getPartialValue()
Returns a value that was only partially computed due to this exception. The caller can use this while collecting additional configuration problems.- Returns:
- the partial value, or
null
if none was set. The type of the partial value is specified by the throwing method.
-
getMessage
public java.lang.String getMessage()
- Overrides:
getMessage
in classjava.lang.Throwable
-
-