/*
 * CloverETL Engine - Java based ETL application framework.
 * Copyright (c) Javlin, a.s. (info@cloveretl.com).  Use is subject to license terms.
 *
 * www.cloveretl.com
 */
package org.jetel.util;

import java.util.HashMap;

import org.jetel.data.Defaults;
import org.jetel.exception.ComponentNotReadyException;
import org.jetel.util.string.StringUtils;

/**
 * @author whancock (info@cloveretl.com)
 *         (c) Javlin, a.s. (www.cloveretl.com)
 *
 * @created Feb 14, 2011
 */
public class MappingUtils {
	
	public static HashMap<String, String> parseMappingString(String mappingString) throws ComponentNotReadyException {
		
		HashMap<String, String> mappingHash = new HashMap<String, String>();
		String[] splitMapping = StringUtils.split(mappingString);
		
		for(String mapping: splitMapping) {
			String[] parsedExpression = mapping.split(Defaults.ASSIGN_SIGN);
			String inputField = parsedExpression[1].trim();
			String outputField = parsedExpression[0].trim();
			
			mappingHash.put(inputField, outputField);
		}
		
		return mappingHash;
	}
	
}

@@ -1,15 +1,21 @@
 /*%0D%0A * 
+jETeL/
 CloverET
@@ -20,15 +20,8 @@
 ETL 
-Engine 
 - Ja
@@ -111,69 +111,761 @@
 com)
-.  Use is subject to license terms.%0D%0A *%0D%0A * www.clo
+%0D%0A *  %0D%0A * This library is free software; you can redistribute it and/or%0D%0A * modify it under the terms of the GNU Lesser General Public%0D%0A * License as published by the Free Software Foundation; either%0D%0A * version 2.1 of the License, or (at your option) any later version.%0D%0A *%0D%0A * This library is distributed in the hope that it will be useful,%0D%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0D%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0D%0A * Lesser General Public License for more details.%0D%0A *%0D%0A * You should ha
 ve
+ 
 re
-tl.com
+ceived a copy of the GNU Lesser General Public%0D%0A * License along with this library; if not, write to the Free Software%0D%0A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 %0D%0A *

fix header