/*
 * 作成日: 2008/08/05
 * 著作権: Copyright (c) 2005 ZIGEN
 * ライセンス：Eclipse Public License - v 1.0
 * 原文：http://www.eclipse.org/legal/epl-v10.html
 */
package zigen.plugin.db.ext.s2jdbc.util;

import java.util.ArrayList;
import java.util.List;


public class GenericUtil {
	
	public static List<String> getParametars(String fullyQualifiedParameterizedName) {
		List<String> list = new ArrayList<String>();
		int pos = fullyQualifiedParameterizedName.indexOf("<");
		if (pos > 0 && fullyQualifiedParameterizedName.endsWith(">")) {
			
			String generic = fullyQualifiedParameterizedName.substring(pos + 1, fullyQualifiedParameterizedName.length() - 1);
			String[] elems = generic.split(",");
			
			final String ext = " extends ";
			
			for (int i = 0; i < elems.length; i++) {
				String s = elems[i].trim();
				int p = s.indexOf(ext);
				if (p > 0) {
					list.add(s.substring(p + ext.length()));
				}
			}
		}
		return list;
		
	}
}
