package hu.ibello.transform;

import java.io.Reader;
import java.util.List;

/**
 * Utility class which transforms CSV into a list of java objects.
 * 
 * @author Kornél Simon
 *
 */
public interface CsvTransformer {

	/**
	 * This method reads the given CSV data and loads it into a list.
	 * The first line in the CSV should be the header.
	 * Every other lines will be considered as new object in the list, with the given type.
	 * @param <T> type of the result objects
	 * @param csv the CSV content
	 * @param typeOfT type of the result objects
	 * @return list of objects
	 * @throws TransformerException if csv is not a valid CSV file
	 */
	public <T> List<T> fromCsv(String csv, Class<T> typeOfT) throws TransformerException;
	
	/**
	 * This method reads the given CSV data and loads it into a list.
	 * The first line in the CSV should be the header.
	 * Every other lines will be considered as new object in the list, with the given type.
	 * @param <T> type of the result objects
	 * @param csv the Reader containing CSV data
	 * @param typeOfT type of the objects
	 * @return list of objects
	 * @throws TransformerException if csv is not a valid CSV file
	 */
	public <T> List<T> fromCsv(Reader csv, Class<T> typeOfT) throws TransformerException;
}

@@ -1,8 +1,606 @@
+/*%0A * Ark-Sys Kft. licenses this file to you under%0A * the Apache License, Version 2.0 (the %22License%22); you may%0A * not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A */%0A
 package 

comment section in source file