Package org.minijax.cdi
Class MinijaxInjector
java.lang.Object
org.minijax.cdi.MinijaxInjector
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class MinijaxInjector
extends java.lang.Object
implements java.io.Closeable
The MinijaxInjector class provides a Minijax-container-aware implementation of Java CDI (JSR 330).
The implementation is heavily inspired by Feather.
-
Constructor Summary
Constructors Constructor Description MinijaxInjector() -
Method Summary
Modifier and Type Method Description voidaddFieldAnnotationProcessor(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, FieldAnnotationProcessor<?> processor)voidaddTypeAnnotationProcessor(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, TypeAnnotationProcessor<?> processor)MinijaxInjectorbind(java.lang.Class<?> component, java.lang.Class<?> contract)MinijaxInjectorbind(java.lang.Class<?> component, java.lang.Class<?> contract, java.lang.Class<? extends java.lang.annotation.Annotation> qualifier)MinijaxInjectorbind(java.lang.Class<?> component, java.lang.Class<?> contract, java.lang.String name)MinijaxInjectorbind(java.lang.Object instance, java.lang.Class<?> contract)voidclose()<T> MinijaxProvider<T>getProvider(java.lang.Class<T> c)<T> MinijaxProvider<T>getProvider(java.lang.Class<T> c, java.lang.annotation.Annotation[] annotations)<T> TgetResource(java.lang.Class<T> c)<T> TgetResource(java.lang.Class<T> c, java.lang.Object context)java.util.Set<java.lang.Object>getSingletons()<T> TinitResource(T resource, java.lang.Object context)booleanisInjectedField(java.lang.Class<?> annotationType)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MinijaxInjector
public MinijaxInjector()
-
-
Method Details
-
addTypeAnnotationProcessor
public void addTypeAnnotationProcessor(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, TypeAnnotationProcessor<?> processor) -
addFieldAnnotationProcessor
public void addFieldAnnotationProcessor(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, FieldAnnotationProcessor<?> processor) -
isInjectedField
public boolean isInjectedField(java.lang.Class<?> annotationType) -
bind
-
bind
-
bind
public MinijaxInjector bind(java.lang.Class<?> component, java.lang.Class<?> contract, java.lang.Class<? extends java.lang.annotation.Annotation> qualifier) -
bind
public MinijaxInjector bind(java.lang.Class<?> component, java.lang.Class<?> contract, java.lang.String name) -
getSingletons
public java.util.Set<java.lang.Object> getSingletons() -
getResource
public <T> T getResource(java.lang.Class<T> c) -
getResource
public <T> T getResource(java.lang.Class<T> c, java.lang.Object context) -
initResource
public <T> T initResource(T resource, java.lang.Object context) -
getProvider
-
getProvider
public <T> MinijaxProvider<T> getProvider(java.lang.Class<T> c, java.lang.annotation.Annotation[] annotations) -
close
public void close()- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-