com.talk2object.plum.viewgeneration.viewbuilder.BeanViewBuilder Maven / Gradle / Ivy
package com.talk2object.plum.viewgeneration.viewbuilder;
import com.talk2object.plum.interaction.application.PlumApplicationContextUtils;
import com.talk2object.plum.interaction.model.Bean;
import com.talk2object.plum.view.component.Component;
import com.talk2object.plum.viewgeneration.AbstractPrivateViewBuilder;
import com.talk2object.plum.viewgeneration.ViewBuildContext;
/**
* general builder for Java Bean model.
*
* @author jack
*
*/
public class BeanViewBuilder extends AbstractPrivateViewBuilder {
public BeanViewBuilder() {
supportedViewClasses.add(Component.class);
}
@Override
public Class getModelClass() {
return Bean.class;
}
@Override
public Component build(Object model, Class viewClass,
ViewBuildContext context) {
com.talk2object.plum.viewgeneration.ViewFactory viewFactory = PlumApplicationContextUtils
.getViewFactory();
if (viewClass == Component.class) {
String str = model.toString();
return viewFactory.create(str, viewClass);
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy