本文整理汇总了Java中org.apache.commons.beanutils.BasicDynaBean类的典型用法代码示例。如果您正苦于以下问题:Java BasicDynaBean类的具体用法?Java BasicDynaBean怎么用?Java BasicDynaBean使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BasicDynaBean类属于org.apache.commons.beanutils包,在下文中一共展示了BasicDynaBean类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: objectArrayToBean
import org.apache.commons.beanutils.BasicDynaBean; //导入依赖的package包/类
/**
* Constructs a DynaBean using the values and properties specified.
* @param values property values.
* @param properties properties to add to the bean.
* @param classes properties types.
* @return DynBean with the values and properties specified.
*/
protected DynaBean objectArrayToBean(Object[] values, String[] properties, Class<?>[] classes) {
DynaBean dynaBean = null;
try {
DynaProperty[] columnsDynaProperties = getColumnsDynaProperties(properties, classes);
BasicDynaClass clazz = new BasicDynaClass(this.getClass().getSimpleName(), BasicDynaBean.class, columnsDynaProperties);
dynaBean = clazz.newInstance();
for(int i = 0; i < columnsDynaProperties.length; i++) {
dynaBean.set(columnsDynaProperties[i].getName(), values[i]);
}
} catch (Exception e) {
throw new RuntimeException("Error creating dynamic bean", e);
}
return dynaBean;
}
开发者ID:alejandro-du,项目名称:enterprise-app,代码行数:26,代码来源:DefaultHbnContainer.java
示例2: setUp
import org.apache.commons.beanutils.BasicDynaBean; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
target = new BasicDynaBean(new BasicDynaClass("target", null, new DynaProperty[] {
new DynaProperty("string", String.class),
new DynaProperty("integer", int.class)
}));
decorated = context.mock(Fixture.class);
fixture = new DynaBeanFixture(decorated);
}
开发者ID:strator-dev,项目名称:greenpepper,代码行数:11,代码来源:DynaBeanFixtureTest.java
示例3: getCellTemplate
import org.apache.commons.beanutils.BasicDynaBean; //导入依赖的package包/类
public String getCellTemplate(Object aCollectionItem) {
if (aCollectionItem != null) {
if (aCollectionItem instanceof BasicDynaBean) {
Object temp = null;
try {
temp = ((BasicDynaBean) aCollectionItem).get(TEMPLATE_CELL);
} catch (IllegalArgumentException e) {
}
if (temp != null) {
return (String) temp;
}
}
}
return "";
}
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:16,代码来源:ExcelRowProcessor.java
示例4: updateReport
import org.apache.commons.beanutils.BasicDynaBean; //导入依赖的package包/类
@Override
public void updateReport() {
table.setContainerDataSource(null);
String[] columnProperties = getColumnProperties();
Class<?>[] columnClasses = getColumnClasses();
String[] columnTitles = getColumnTitles();
for(int i = 0; i < columnProperties.length; i++) {
table.addContainerProperty(columnProperties[i], columnClasses[i], null, columnTitles[i], null, null);
}
for(int i = 0; i < columnProperties.length; i++) {
if(!columnsCheckBoxes[i].booleanValue()) {
table.setColumnCollapsed(columnProperties[i], true);
}
}
Collection<?> data = getData();
if(data != null) {
for(Object row : data) {
BasicDynaBean bean = (BasicDynaBean) row;
Object[] cells = new Object[columnProperties.length];
for(int i = 0; i < columnProperties.length; i++) {
cells[i] = bean.get(columnProperties[i]);
}
table.addItem(cells, row);
}
}
}
开发者ID:alejandro-du,项目名称:enterprise-app,代码行数:34,代码来源:TableViewReport.java
注:本文中的org.apache.commons.beanutils.BasicDynaBean类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论