use of amerifrance.guideapi.api.GuideBook in project Guide-API by TeamAmeriFrance.
the class AnnotationHandler method registerBooks.
public static void registerBooks(ASMDataTable dataTable) {
for (ASMDataTable.ASMData data : dataTable.getAll(GuideBook.class.getCanonicalName())) {
try {
Class<?> genericClass = Class.forName(data.getClassName());
if (!IGuideBook.class.isAssignableFrom(genericClass))
continue;
IGuideBook guideBook = (IGuideBook) genericClass.newInstance();
Book book = guideBook.buildBook();
if (book == null)
continue;
APISetter.registerBook(book);
BOOK_CLASSES.add(Pair.of(book, guideBook));
} catch (Exception e) {
LogHelper.error("Error registering book for class " + data.getClassName());
e.printStackTrace();
}
}
APISetter.setIndexedBooks(Lists.newArrayList(GuideAPI.getBooks().values()));
}
Aggregations