net.sf.doolin.tabular.support.PropertyTabularColumn Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of doolin-tabular Show documentation
Show all versions of doolin-tabular Show documentation
This Doolin GUI module is an extension that allows writing
tabular data (CSV, Excel).
The newest version!
package net.sf.doolin.tabular.support;
import net.sf.doolin.util.Utils;
/**
* Column based on a property of an item.
*
* @author Damien Coraboeuf
*
* @param
* Type of data in the rows
*/
public class PropertyTabularColumn extends AbstractTabularColumn {
private final String propertyPath;
/**
* Constructor
*
* @param title
* Title of the column
* @param propertyPath
* Path to the property of the row item to take as the column
* value
*/
public PropertyTabularColumn(String title, String propertyPath) {
super(title);
this.propertyPath = propertyPath;
}
@Override
public Object getValue(T item) {
return Utils.getProperty(item, this.propertyPath);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy