
net.cassite.pure.ioc.handlers.ParamHandlerChain Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pure.ioc Show documentation
Show all versions of pure.ioc Show documentation
Lightweight type and annotation based dependency injection framework
The newest version!
package net.cassite.pure.ioc.handlers;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class ParamHandlerChain {
private static final Logger LOGGER = LoggerFactory.getLogger(ParamHandlerChain.class);
private final Iterator it;
public ParamHandlerChain(List handlers, Annotation[] anns) {
List list = new ArrayList<>();
handlers.forEach(h -> {
if (h.canHandle(anns)) {
list.add(h);
}
});
list.add(EmptyHandler.getInstance());
LOGGER.debug("Generate Param Chain with Handlers: {}", list);
it = list.iterator();
}
public ParamAnnotationHandler next() {
return it.next();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy