All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nico.aoc.loader.BookLoader Maven / Gradle / Ivy

There is a newer version: 1.1.3
Show newest version
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.AocAbstractScanner;
import org.nico.aoc.scan.AocAnnotationScanner;
import org.nico.aoc.scan.AocConfigScanner;
import org.nico.aoc.scan.handler.LoaderHandlerQueue;

/** 
 * 
 * @author nico
 * @version createTime:2018年4月15日 下午1:59:13
 */

public class BookLoader {

	static AocAbstractScanner configScanner = new AocConfigScanner();
	static AocAbstractScanner annotationScanner = new AocAnnotationScanner();
	
	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);
			}
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy