public final class DependencyModel extends Object implements Binder, org.qi4j.api.composite.DependencyDescriptor, org.qi4j.functional.Visitable<DependencyModel>
| Modifier and Type | Class and Description |
|---|---|
static class |
DependencyModel.InjectionTypeFunction |
static class |
DependencyModel.ScopeSpecification |
| Constructor and Description |
|---|
DependencyModel(Annotation injectionAnnotation,
Type genericType,
Class<?> injectedClass,
boolean optional,
Annotation[] annotations) |
| Modifier and Type | Method and Description |
|---|---|
<ThrowableType extends Throwable> |
accept(org.qi4j.functional.Visitor<? super DependencyModel,ThrowableType> visitor) |
Annotation[] |
annotations() |
void |
bind(Resolution resolution) |
boolean |
hasScope(Class<? extends Annotation> scope) |
Object |
inject(InjectionContext context) |
Class<?> |
injectedClass() |
Annotation |
injectionAnnotation() |
Class<? extends Annotation> |
injectionAnnotationType() |
Type |
injectionType() |
static boolean |
isOptional(Annotation injectionAnnotation,
Annotation[] annotations) |
boolean |
optional() |
Class<?> |
rawInjectionType()
Get the raw dependency type.
|
String |
toString() |
public DependencyModel(Annotation injectionAnnotation, Type genericType, Class<?> injectedClass, boolean optional, Annotation[] annotations)
public static boolean isOptional(Annotation injectionAnnotation, Annotation[] annotations)
public <ThrowableType extends Throwable> boolean accept(org.qi4j.functional.Visitor<? super DependencyModel,ThrowableType> visitor) throws ThrowableType extends Throwable
accept in interface org.qi4j.functional.Visitable<DependencyModel>ThrowableType extends Throwablepublic Annotation injectionAnnotation()
injectionAnnotation in interface org.qi4j.api.composite.DependencyDescriptorpublic Type injectionType()
injectionType in interface org.qi4j.api.composite.DependencyDescriptorpublic Class<?> injectedClass()
injectedClass in interface org.qi4j.api.composite.DependencyDescriptorpublic Class<?> rawInjectionType()
If the dependency uses generics this is the raw type, and otherwise it is the type of the field.
Examples:
@Service MyService service -> MyService
@Entity Iterable<Foo> fooList -> Iterable
@Entity Query<Foo> fooQuery -> Query
rawInjectionType in interface org.qi4j.api.composite.DependencyDescriptorpublic boolean optional()
optional in interface org.qi4j.api.composite.DependencyDescriptorpublic Annotation[] annotations()
annotations in interface org.qi4j.api.composite.DependencyDescriptorpublic void bind(Resolution resolution) throws org.qi4j.bootstrap.BindingException
public Object inject(InjectionContext context)
public boolean hasScope(Class<? extends Annotation> scope)
public Class<? extends Annotation> injectionAnnotationType()