public void computeParameter(String signature, StringBuilder uriBuilder) { int signatureKind = Signature.getTypeSignatureKind(signature); if (signatureKind == Signature.WILDCARD_TYPE_SIGNATURE) { switch (signature.charAt(0)) { case '*': { uriBuilder.append("? extends java.lang.Object"); } break; case '+': { uriBuilder.append("? extends "); String upperBoundSignature = signature.substring(1); computeParameterizedTypeName(upperBoundSignature, uriBuilder); } break; case '-': { uriBuilder.append("? extends java.lang.Object & super "); String lowerBoundSignature = signature.substring(1); computeParameterizedTypeName(lowerBoundSignature, uriBuilder); } break; default: throw new IllegalArgumentException("Signature: " + signature); } } else { computeParameterizedTypeName(signature, uriBuilder); } }
public String computeParameterizedTypeName(String signature) { StringBuilder result = new StringBuilder(64); computeParameterizedTypeName(signature, result); return result.toString(); }