com.sun.hk2.component
Class InjectInjectionResolver
java.lang.Object
com.sun.hk2.component.InjectionResolver<org.jvnet.hk2.annotations.Inject>
com.sun.hk2.component.InjectInjectionResolver
- All Implemented Interfaces:
- InjectionResolverQuery
public class InjectInjectionResolver
- extends InjectionResolver<org.jvnet.hk2.annotations.Inject>
InjectInjectionResolver, handles all Inject annotations
|
Method Summary |
protected
<V> java.util.Collection<V> |
|
getAllByContract(Inhabitant<?> onBehalfOf,
Habitat habitat,
java.lang.Class<V> ct)
|
protected
<V> java.util.Collection<V> |
|
getAllByType(Inhabitant<?> onBehalfOf,
Habitat habitat,
java.lang.Class<V> ct)
|
protected
|
getArrayInjectValue(Habitat habitat,
java.lang.Object component,
Inhabitant<?> onBehalfOf,
java.lang.reflect.AnnotatedElement target,
java.lang.reflect.Type genericType,
java.lang.Class<V> type)
|
protected
|
getComponentInjectValue(Habitat habitat,
java.lang.Object component,
Inhabitant<?> onBehalfOf,
java.lang.reflect.AnnotatedElement target,
java.lang.reflect.Type genericType,
java.lang.Class<V> type,
org.jvnet.hk2.annotations.Inject inject)
|
protected
|
getHolderInjectValue(Habitat habitat,
java.lang.Object component,
Inhabitant<?> onBehalfOf,
java.lang.reflect.AnnotatedElement target,
java.lang.reflect.Type genericType,
java.lang.Class<V> type,
org.jvnet.hk2.annotations.Inject inject)
|
protected Inhabitant<?> |
getInhabitantByType(Inhabitant<?> onBehalfOf,
Habitat habitat,
java.lang.Class<?> finalType)
|
protected
<V> java.util.Collection<V> |
|
getInhabitants(Inhabitant<?> onBehalfOf,
Habitat habitat,
java.lang.Class<?> finalType,
java.lang.String name)
|
protected
|
getServiceInjectValue(Habitat habitat,
java.lang.Object component,
Inhabitant<?> onBehalfOf,
java.lang.reflect.AnnotatedElement target,
java.lang.reflect.Type genericType,
java.lang.Class<V> type,
org.jvnet.hk2.annotations.Inject inject)
|
|
getValue(java.lang.Object component,
Inhabitant<?> onBehalfOf,
java.lang.reflect.AnnotatedElement target,
java.lang.reflect.Type genericType,
java.lang.Class<V> type)
Obtains the value to inject, based on the type and Inject annotation. |
boolean |
isOptional(java.lang.reflect.AnnotatedElement element,
org.jvnet.hk2.annotations.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
<V> java.util.Collection<V> |
|
manage(Inhabitant<?> onBehalfOf,
java.lang.Iterable<?> inhabitants)
|
protected
|
validate(java.lang.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(java.lang.reflect.AnnotatedElement element,
org.jvnet.hk2.annotations.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<org.jvnet.hk2.annotations.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(java.lang.Object component,
Inhabitant<?> onBehalfOf,
java.lang.reflect.AnnotatedElement target,
java.lang.reflect.Type genericType,
java.lang.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,
java.lang.Object component,
Inhabitant<?> onBehalfOf,
java.lang.reflect.AnnotatedElement target,
java.lang.reflect.Type genericType,
java.lang.Class<V> type)
getHolderInjectValue
protected <V> V getHolderInjectValue(Habitat habitat,
java.lang.Object component,
Inhabitant<?> onBehalfOf,
java.lang.reflect.AnnotatedElement target,
java.lang.reflect.Type genericType,
java.lang.Class<V> type,
org.jvnet.hk2.annotations.Inject inject)
throws ComponentException
- Throws:
ComponentException
getServiceInjectValue
protected <V> V getServiceInjectValue(Habitat habitat,
java.lang.Object component,
Inhabitant<?> onBehalfOf,
java.lang.reflect.AnnotatedElement target,
java.lang.reflect.Type genericType,
java.lang.Class<V> type,
org.jvnet.hk2.annotations.Inject inject)
throws ComponentException
- Throws:
ComponentException
getComponentInjectValue
protected <V> V getComponentInjectValue(Habitat habitat,
java.lang.Object component,
Inhabitant<?> onBehalfOf,
java.lang.reflect.AnnotatedElement target,
java.lang.reflect.Type genericType,
java.lang.Class<V> type,
org.jvnet.hk2.annotations.Inject inject)
throws ComponentException
- Throws:
ComponentException
validate
protected <V> V validate(java.lang.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> java.util.Collection<V> manage(Inhabitant<?> onBehalfOf,
java.lang.Iterable<?> inhabitants)
getInhabitantByType
protected Inhabitant<?> getInhabitantByType(Inhabitant<?> onBehalfOf,
Habitat habitat,
java.lang.Class<?> finalType)
getInhabitants
protected <V> java.util.Collection<V> getInhabitants(Inhabitant<?> onBehalfOf,
Habitat habitat,
java.lang.Class<?> finalType,
java.lang.String name)
getAllByType
protected <V> java.util.Collection<V> getAllByType(Inhabitant<?> onBehalfOf,
Habitat habitat,
java.lang.Class<V> ct)
getAllByContract
protected <V> java.util.Collection<V> getAllByContract(Inhabitant<?> onBehalfOf,
Habitat habitat,
java.lang.Class<V> ct)
Copyright © 2011 Oracle Corporation. All Rights Reserved.