|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.inject.spi.InjectionPoint
public final class InjectionPoint
A constructor, field or method that can receive injections. Typically this is a member with the
@Inject
annotation. For non-private, no argument constructors, the member may
omit the annotation.
Method Summary | |
---|---|
static void |
addForInstanceMethodsAndFields(Class<?> type,
Collection<InjectionPoint> sink)
Adds all instance method and field injection points on type to injectionPoints . |
static void |
addForStaticMethodsAndFields(Class<?> type,
Collection<InjectionPoint> sink)
Adds all static method and field injection points on type to injectionPoints . |
boolean |
equals(Object o)
|
static InjectionPoint |
forConstructorOf(Class<?> type)
Returns a new injection point for the injectable constructor of type . |
List<Dependency<?>> |
getDependencies()
Returns the dependencies for this injection point. |
Member |
getMember()
Returns the injected constructor, field, or method. |
int |
hashCode()
|
boolean |
isOptional()
Returns true if this injection point shall be skipped if the injector cannot resolve bindings for all required dependencies. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public Member getMember()
public List<Dependency<?>> getDependencies()
public boolean isOptional()
ImplementedBy
, default
constructors etc.) may be used to satisfy optional injection points.
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public static InjectionPoint forConstructorOf(Class<?> type)
type
.
type
- a concrete type with exactly one constructor annotated @Inject
,
or a no-arguments constructor that is not private.
RuntimeException
- if there is no injectable constructor, more than one injectable
constructor, or if parameters of the injectable constructor are malformed, such as a
parameter with multiple binding annotations.public static void addForStaticMethodsAndFields(Class<?> type, Collection<InjectionPoint> sink)
type
to injectionPoints
.
All fields are added first, and then all methods. Within the fields, supertype fields are added
before subtype fields. Similarly, supertype methods are added before subtype methods.
RuntimeException
- if there is a malformed injection point on type
, such as a
field with multiple binding annotations. When such an exception is thrown, the valid
injection points are still added to the collection.public static void addForInstanceMethodsAndFields(Class<?> type, Collection<InjectionPoint> sink)
type
to injectionPoints
.
All fields are added first, and then all methods. Within the fields, supertype fields are added
before subtype fields. Similarly, supertype methods are added before subtype methods.
RuntimeException
- if there is a malformed injection point on type
, such as a
field with multiple binding annotations. When such an exception is thrown, the valid
injection points are still added to the collection.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |