Does anybody know if I can inject an inner class in my object? I want to write something like that:
@Named
public class ClassA {
@Inject
private InnerClass myObject;
public class InnerClass extends DefaultImplementation implements Serializable{
public String overriddenMethod() {
// do something special
}
}
}
I want to do these strange things because I have a default implementation which I use for injection in 80 percent of my use cases. But for special logic I have to override some methods in the default implementation.
I dont want to create an extra class file because I want to override two lines of code only.
If I try the code in my OpenWebBeans-Contrainer, I get the following Error:
javax.enterprise.inject.UnsatisfiedResolutionException: Api type [ClassA$InnerClass] is not found with the qualifiers Qualifiers: [@javax.enterprise.inject.Default()] for injection into Field: private ClassA$InnerClass ClassA.myObject