Component registration info - Dependencies from all parents

This commit is contained in:
Emmanuel BENOîT 2015-09-14 08:44:27 +02:00
parent f115bb7168
commit b13db82be2

View file

@ -13,6 +13,7 @@ import java.util.HashSet;
import info.ebenoit.ebul.func.ThrowingBiConsumer;
import info.ebenoit.ebul.func.ThrowingConsumer;
import info.ebenoit.ebul.func.ThrowingSupplier;
import info.ebenoit.ebul.reflection.Annotations;
import info.ebenoit.ebul.reflection.MemberFinder;
@ -74,8 +75,8 @@ public final class NewComponentInfo< T >
}
// Explicit dependencies
final Dependencies dependencies = klass.getAnnotation( Dependencies.class );
if ( dependencies != null ) {
for ( Class< ? super T > c : Annotations.findParentsWith( klass , Dependencies.class ) ) {
final Dependencies dependencies = c.getDeclaredAnnotation( Dependencies.class );
for ( final String dependency : dependencies.value( ) ) {
info.addDependency( dependency );
}