for (MetaClass pageClass : pages) {
if (!pageClass.isAssignableTo(IsWidget.class)) {
throw new GenerationException(
"Class " + pageClass.getFullyQualifiedName() + " is annotated with @Page, so it must implement IsWidget");
}
Page annotation = pageClass.getAnnotation(Page.class);
String pageName = getPageName(pageClass);
List<Class<? extends PageRole>> annotatedPageRoles = Arrays.asList(annotation.role());
MetaClass prevPageWithThisName = pageNames.put(pageName, pageClass);
if (prevPageWithThisName != null) {
throw new GenerationException(
"Page names must be unique, but " + prevPageWithThisName + " and " + pageClass +
" are both named [" + pageName + "]");
}
Statement pageImplStmt = generateNewInstanceOfPageImpl(pageClass, pageName);
if (annotation.startingPage() || annotatedPageRoles.contains(DefaultPage.class)) {
if (annotation.startingPage()) {
pageRoles.put(DefaultPage.class, pageClass);
logger.log(TreeLogger.Type.WARN, "You are using the deprecated statingPage place change to role = DefaultPage.class");
}
// need to assign the page impl to a variable and add it to the map twice