Here you can find the source of extractGenericTypeNames(String sig)
public static List<String> extractGenericTypeNames(String sig)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static List<String> extractGenericTypeNames(String sig) { List<String> types = new ArrayList<String>(); boolean nameDetected = false; int currentStart = -1; for (int i = 0; i < sig.length(); i++) { char c = sig.charAt(i); switch (c) { case '<': case ';': if (!nameDetected) { nameDetected = true; currentStart = i + 1; }//from ww w. j a va2 s .co m break; case ':': types.add(sig.substring(currentStart, i)); nameDetected = false; break; } } return types; } }