public static String stripGenerics(String type) { if (isClassArray(type)) { type = fixClassArray(type); } if (isGeneric(type)) { return type.substring(0, type.indexOf('<')) + type.substring(type.lastIndexOf('>') + 1).trim(); } else { return type.trim(); } }
public static String stripGenerics(String type) { if (isClassArray(type)) { type = fixClassArray(type); } if (isGeneric(type)) { return type.substring(0, type.indexOf('<')) + type.substring(type.lastIndexOf('>') + 1).trim(); } else { return type.trim(); } }
public static String stripArray(final String type) { String result = type; if (isClassArray(type)) { result = fixClassArray(type); } if (isArray(result)) { Matcher matcher; matcher = SIMPLE_ARRAY_PATTERN.matcher(result); if (matcher.find()) { int idx = result.length() - 2; while (idx > 1 && result.charAt(idx - 2) == '[') { idx -= 2; } result = result.substring(0, idx); } else { return result; } } return result; }
public static String stripArray(final String type) { String result = type; if (isClassArray(type)) { result = fixClassArray(type); } if (isArray(result)) { Matcher matcher; matcher = SIMPLE_ARRAY_PATTERN.matcher(result); if (matcher.find()) { int idx = result.length() - 2; while (idx > 1 && result.charAt(idx - 2) == '[') { idx -= 2; } result = result.substring(0, idx); } else { return result; } } return result; }