|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
I
- the injectable type encounteredpublic interface TypeEncounter<I>
Context of an injectable type encounter. Enables reporting errors, registering injection
listeners and binding method interceptors for injectable type I
. It is an error to use
an encounter after the hear()
method has
returned.
Method Summary | ||
---|---|---|
void |
addError(Message message)
Records an error message to be presented to the user at a later time. |
|
void |
addError(String message,
Object... arguments)
Records an error message for type I which will be presented to the user at a later
time. |
|
void |
addError(Throwable t)
Records an exception for type I , the full details of which will be logged, and the
message of which will be presented to the user at a later time. |
|
void |
bindInterceptor(Matcher<? super Method> methodMatcher,
MethodInterceptor... interceptors)
Binds method interceptor[s] to methods matched in type I and its supertypes. |
|
|
getMembersInjector(Class<T> type)
Returns the members injector used to inject dependencies into methods and fields on instances of the given type T . |
|
|
getMembersInjector(TypeLiteral<T> typeLiteral)
Returns the members injector used to inject dependencies into methods and fields on instances of the given type T . |
|
|
getProvider(Class<T> type)
Returns the provider used to obtain instances for the given injection type. |
|
|
getProvider(Key<T> key)
Returns the provider used to obtain instances for the given injection key. |
|
void |
register(InjectionListener<? super I> listener)
Registers an injection listener for type I . |
|
void |
register(MembersInjector<? super I> membersInjector)
Registers a members injector for type I . |
Method Detail |
---|
void addError(String message, Object... arguments)
I
which will be presented to the user at a later
time. Unlike throwing an exception, this enable us to continue configuring the Injector and
discover more errors. Uses String.format(String, Object[])
to insert the arguments
into the message.
void addError(Throwable t)
I
, the full details of which will be logged, and the
message of which will be presented to the user at a later time. If your type listener calls
something that you worry may fail, you should catch the exception and pass it to this method.
void addError(Message message)
<T> Provider<T> getProvider(Key<T> key)
IllegalStateException
if you try to use it beforehand.
<T> Provider<T> getProvider(Class<T> type)
IllegalStateException
if you try to use it beforehand.
<T> MembersInjector<T> getMembersInjector(TypeLiteral<T> typeLiteral)
T
. The returned members injector will not be valid until the main
injector has been created. The members injector will throw an IllegalStateException
if you try to use it beforehand.
typeLiteral
- type to get members injector for<T> MembersInjector<T> getMembersInjector(Class<T> type)
T
. The returned members injector will not be valid until the main
injector has been created. The members injector will throw an IllegalStateException
if you try to use it beforehand.
type
- type to get members injector forvoid register(MembersInjector<? super I> membersInjector)
I
. Guice will use the members injector after its
performed its own injections on an instance of I
.
void register(InjectionListener<? super I> listener)
I
. Guice will notify the listener after all
injections have been performed on an instance of I
.
void bindInterceptor(Matcher<? super Method> methodMatcher, MethodInterceptor... interceptors)
I
and its supertypes. A
method is eligible for interception if:
methodMatcher
- matches methods the interceptor should apply to. For
example: annotatedWith(Transactional.class)
.interceptors
- to bind
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |