com.sun.hk2.component
Class InjectInjectionResolver
java.lang.Object
com.sun.hk2.component.InjectionResolver<Inject>
com.sun.hk2.component.InjectInjectionResolver
- All Implemented Interfaces:
- InjectionResolverQuery
public class InjectInjectionResolver
- extends InjectionResolver<Inject>
InjectInjectionResolver, handles all Inject annotations
|
Method Summary |
protected
|
getAllByContract(Inhabitant<?> onBehalfOf,
Habitat habitat,
Class<V> ct)
|
protected
|
getAllByType(Inhabitant<?> onBehalfOf,
Habitat habitat,
Class<V> ct)
|
protected
|
getArrayInjectValue(Habitat habitat,
Object component,
Inhabitant<?> onBehalfOf,
AnnotatedElement target,
Type genericType,
Class<V> type)
|
protected
|
getHolderInjectValue(Habitat habitat,
Object component,
Inhabitant<?> onBehalfOf,
AnnotatedElement target,
Type genericType,
Class<V> type,
Inject inject)
|
protected
|
getProviderByContract(Habitat habitat,
Inhabitant<?> onBehalfOf,
AnnotatedElement target,
Type genericType,
Inject inject)
|
|
getValue(Object component,
Inhabitant<?> onBehalfOf,
AnnotatedElement target,
Type genericType,
Class<V> type)
Obtains the value to inject, based on the type and Inject annotation. |
boolean |
isOptional(AnnotatedElement element,
Inject annotation)
Returns true if the resolution of this injection identified by the
passed annotation instance is optional |
protected Inhabitant<?> |
manage(Inhabitant<?> onBehalfOf,
Inhabitant<?> inhabitant)
|
protected
|
manage(Inhabitant<?> onBehalfOf,
Iterable<?> inhabitants)
|
protected
|
validate(Object component,
Inhabitant<?> onBehalfOf,
V toBeInjected)
Verifies the injection does not violate any integrity rules. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InjectInjectionResolver
public InjectInjectionResolver(Habitat habitat)
isOptional
public boolean isOptional(AnnotatedElement element,
Inject annotation)
- Description copied from class:
InjectionResolver
- Returns true if the resolution of this injection identified by the
passed annotation instance is optional
- Overrides:
isOptional in class InjectionResolver<Inject>
- Parameters:
element - is the annotated java element Method
or Fieldannotation - the injection metadata
- Returns:
- true if the
getValue() can return null without generating a
faulty injection operation
getValue
public <V> V getValue(Object component,
Inhabitant<?> onBehalfOf,
AnnotatedElement target,
Type genericType,
Class<V> type)
throws ComponentException
- Obtains the value to inject, based on the type and
Inject annotation.
- Parameters:
component - injection target instanceonBehalfOf - inhabitant doing the injection fortarget - is the annotated java element Method
or FieldgenericType - the generic type of the expected returntype - type of the expected return
- Returns:
- the resource to be injected
- Throws:
ComponentException - if the resource cannot be located.
getArrayInjectValue
protected <V> V getArrayInjectValue(Habitat habitat,
Object component,
Inhabitant<?> onBehalfOf,
AnnotatedElement target,
Type genericType,
Class<V> type)
getHolderInjectValue
protected <V> V getHolderInjectValue(Habitat habitat,
Object component,
Inhabitant<?> onBehalfOf,
AnnotatedElement target,
Type genericType,
Class<V> type,
Inject inject)
throws ComponentException
- Throws:
ComponentException
getProviderByContract
protected <V> Provider<V> getProviderByContract(Habitat habitat,
Inhabitant<?> onBehalfOf,
AnnotatedElement target,
Type genericType,
Inject inject)
throws ComponentException
- Throws:
ComponentException
validate
protected <V> V validate(Object component,
Inhabitant<?> onBehalfOf,
V toBeInjected)
- Verifies the injection does not violate any integrity rules.
- Parameters:
component - the target component to be injectedtoBeInjected - the injected value
manage
protected Inhabitant<?> manage(Inhabitant<?> onBehalfOf,
Inhabitant<?> inhabitant)
manage
protected <V> Collection<V> manage(Inhabitant<?> onBehalfOf,
Iterable<?> inhabitants)
getAllByType
protected <V> Collection<V> getAllByType(Inhabitant<?> onBehalfOf,
Habitat habitat,
Class<V> ct)
getAllByContract
protected <V> Collection<V> getAllByContract(Inhabitant<?> onBehalfOf,
Habitat habitat,
Class<V> ct)
Copyright © 2011 Oracle Corporation. All Rights Reserved.