All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.doolin.tabular.support.PropertyTabularColumn Maven / Gradle / Ivy

Go to download

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