public class ReflectionDesire extends Object implements Desire, Serializable
InjectionPoint
.Modifier and Type | Class and Description |
---|---|
static class |
ReflectionDesire.Signature |
Constructor and Description |
---|
ReflectionDesire(Class<?> desiredType,
InjectionPoint injectPoint,
Satisfaction satisfaction)
Create a ReflectionDesire that represents the dependency for
desiredType that will be injected into the given InjectionPoint.
|
ReflectionDesire(InjectionPoint injectPoint)
Create a ReflectionDesire that immediately wraps the given
InjectionPoint.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Class<?> |
getDesiredType() |
static List<Desire> |
getDesires(Class<?> type)
Return a list of desires that must satisfied in order to instantiate the
given type.
|
InjectionPoint |
getInjectionPoint() |
Satisfaction |
getSatisfaction()
Get the satisfaction (concrete type) if this desire is fully resolved.
|
int |
hashCode() |
boolean |
isInstantiable()
Query whether this desire is instantiable, that is, resolved to a
concrete type.
|
Desire |
restrict(Class<?> type)
Return a new Desire that restricts the type of this desire to the given
class.
|
Desire |
restrict(Satisfaction satis)
Return a new Desire that restricts the type of this desire to the erased
type of the satisfaction.
|
String |
toString() |
public ReflectionDesire(InjectionPoint injectPoint)
injectPoint
- The injection point to wrapNullPointerException
- if injectPoint is nullpublic ReflectionDesire(Class<?> desiredType, InjectionPoint injectPoint, Satisfaction satisfaction)
desiredType
- The desired type of the dependencyinjectPoint
- The injection point of the desiresatisfaction
- The satisfaction satisfying this desire, if there is
oneNullPointerException
- if desiredType, injectPoint, or dfltSource is nullIllegalArgumentException
- if desiredType is not assignable to the
type of the injection point, or if the satisfaction's type is
not assignable to the desired typepublic static List<Desire> getDesires(Class<?> type)
type
- The class type whose dependencies will be queriedNullPointerException
- if the type is nullpublic Class<?> getDesiredType()
getDesiredType
in interface Desire
public InjectionPoint getInjectionPoint()
getInjectionPoint
in interface Desire
public boolean isInstantiable()
Desire
Desire.getSatisfaction()
.isInstantiable
in interface Desire
public Satisfaction getSatisfaction()
Desire
getSatisfaction
in interface Desire
public Desire restrict(Class<?> type)
Desire
public Desire restrict(Satisfaction satis)
Desire
Desire.getSatisfaction()
.Copyright © 2016 GroupLens Research. All rights reserved.