java.lang.Object |
↳ |
com.google.inject.spi.Message |
Class Overview
An error message and the context in which it occured. Messages are usually created internally by
Guice and its extensions. Messages can be created explicitly in a module using addError()
statements:
try {
bindPropertiesFromFile();
} catch (IOException e) {
addError(e);
}
Summary
Public Constructors |
|
Message(Object source, String message)
|
|
Message(String message)
|
|
Message(String message, Throwable cause)
|
|
Message(List<Object> sources, String message, Throwable cause)
|
Public Methods |
<T>
T
|
acceptVisitor(ElementVisitor<T> visitor)
Accepts an element visitor.
|
void
|
applyTo(Binder binder)
Writes this module element to the given binder (optional operation).
|
boolean
|
equals(Object o)
|
Throwable
|
getCause()
Returns the throwable that caused this message, or null if this
message was not caused by a throwable.
|
String
|
getMessage()
Gets the error message text.
|
String
|
getSource()
Returns an arbitrary object containing information about the "place" where this element was
configured.
|
List<Object>
|
getSources()
|
int
|
hashCode()
|
String
|
toString()
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0)
|
final
void
|
wait(long arg0, int arg1)
|
|
From interface
com.google.inject.spi.Element
abstract
<T>
T
|
acceptVisitor(ElementVisitor<T> visitor)
Accepts an element visitor.
|
abstract
void
|
applyTo(Binder binder)
Writes this module element to the given binder (optional operation).
|
abstract
Object
|
getSource()
Returns an arbitrary object containing information about the "place" where this element was
configured.
|
|
Public Constructors
public
Message
(Object source, String message)
public
Message
(String message)
public
Message
(String message, Throwable cause)
public
Message
(List<Object> sources, String message, Throwable cause)
Public Methods
public
T
acceptVisitor
(ElementVisitor<T> visitor)
Accepts an element visitor. Invokes the visitor method specific to this element's type.
public
void
applyTo
(Binder binder)
Writes this module element to the given binder (optional operation).
Parameters
binder
| to apply configuration element to |
public
boolean
equals
(Object o)
public
Throwable
getCause
()
Returns the throwable that caused this message, or null
if this
message was not caused by a throwable.
public
String
getMessage
()
Gets the error message text.
public
String
getSource
()
Returns an arbitrary object containing information about the "place" where this element was
configured. Used by Guice in the production of descriptive error messages.
Tools might specially handle types they know about; StackTraceElement
is a good
example. Tools should simply call toString()
on the source object if the type is
unfamiliar.
public
List<Object>
getSources
()
public
String
toString
()