class ExtractorLineAggregator<T> implements LineAggregator<T> {

	private FieldExtractor<T> fieldExtractor = new PassThroughFieldExtractor<>();

	/**
	 * Public setter for the field extractor responsible for splitting an input object up
	 * into an array of objects. Defaults to {@link PassThroughFieldExtractor}.
	 * @param fieldExtractor The field extractor to set
	 */
	public void setFieldExtractor(FieldExtractor<T> fieldExtractor) {
		this.fieldExtractor = fieldExtractor;
	}

	/**
	 * Extract fields from the given item using the {@link FieldExtractor} and then
	 * aggregate them. Any null field returned by the extractor will be replaced by an
	 * empty String. Null items are not allowed.
	 *
	 * @see org.springframework.batch.item.file.transform.LineAggregator#aggregate(java.lang.Object)
	 */
	@Override
	public String aggregate(T item) {<FILL_FUNCTION_BODY>}

	/**
	 * Aggregate provided fields into single String.
	 * @param fields An array of the fields that must be aggregated
	 * @return aggregated string
	 */
	protected abstract String doAggregate(Object[] fields);

}

		Assert.notNull(item, "Item is required");
		Object[] fields = this.fieldExtractor.extract(item);

		//
		// Replace nulls with empty strings
		//
		Object[] args = new Object[fields.length];
		for (int i = 0; i < fields.length; i++) {
			if (fields[i] == null) {
				args[i] = "";
			}
			else {
				args[i] = fields[i];
			}
		}

		return this.doAggregate(args);
	
<no_super_class>