org.nico.aoc.loader.BookLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of noaoc Show documentation
Show all versions of noaoc Show documentation
Provides aop and ioc capabilities
package org.nico.aoc.loader;
import java.util.List;
import org.nico.aoc.book.Book;
import org.nico.aoc.book.shop.BookShop;
import org.nico.aoc.scan.AbstractAOCScanner;
import org.nico.aoc.scan.AnnotationScanner;
import org.nico.aoc.scan.ConfigScanner;
import org.nico.aoc.scan.handler.LoaderHandlerQueue;
/**
*
* @author nico
* @version createTime:2018年4月15日 下午1:59:13
*/
public class BookLoader {
static AbstractAOCScanner configScanner = new ConfigScanner();
static AbstractAOCScanner annotationScanner = new AnnotationScanner();
public static void loader(List packs, List uris) throws Throwable{
List newBooks = configScanner.scan(uris);
newBooks.addAll(annotationScanner.scan(packs));
LoaderHandlerQueue.handle(newBooks);
}
public static void loaderByXML(List uris) throws Throwable{
List newBooks = configScanner.scan(uris);
LoaderHandlerQueue.handle(newBooks);
}
public static void loaderByAnnotation(List packs) throws Throwable{
List newBooks = annotationScanner.scan(packs);
LoaderHandlerQueue.handle(newBooks);
BookShop bookShop = BookShop.getInstance();
}
public static void loaderCompent(List compents) throws ClassNotFoundException {
if(compents != null && ! compents.isEmpty()) {
for(String compent: compents) {
Class.forName(compent);
}
}
}
}