use of com.mvp4g.rebind.config.element.ViewElement in project mvp4g by mvp4g.
the class PresenterAnnotationsLoader method loadHandler.
@Override
protected PresenterElement loadHandler(JClassType c, Presenter annotation, Mvp4gConfiguration configuration) throws Mvp4gAnnotationException {
String className = c.getQualifiedSourceName();
String viewName = buildElementNameIfNeeded(annotation.viewName(), className, "View");
PresenterElement presenter = new PresenterElement();
presenter.setView(viewName);
ViewElement view = new ViewElement();
view.setClassName(annotation.view().getCanonicalName());
view.setName(viewName);
addElement(configuration.getViews(), view, c, null);
return presenter;
}
use of com.mvp4g.rebind.config.element.ViewElement in project mvp4g by mvp4g.
the class PresenterAnnotationsLoaderTest method testView.
@Test
public void testView() throws Mvp4gAnnotationException {
List<JClassType> annotedClasses = new ArrayList<JClassType>();
JClassType type = oracle.addClass(getSimpleClass());
annotedClasses.add(type);
loader.load(annotedClasses, configuration);
ViewElement view = configuration.getViews().iterator().next();
assertEquals(view.getClassName(), Object.class.getName());
assertEquals(view.getName(), type.getQualifiedSourceName().replace('.', '_') + "View");
}
Aggregations