/** * Parse a class bound. * * @param parser * The parser. * @param definingClassName * The class containing the type descriptor. * @return The parsed class bound. * @throws ParseException * If the type signature could not be parsed. */ static ReferenceTypeSignature parseClassBound(final Parser parser, final String definingClassName) throws ParseException { parser.expect(':'); // May return null if there is no signature after ':' (class bound signature may be empty) return parseReferenceTypeSignature(parser, definingClassName); } }
/** * Parse a type signature. * * @param parser * The parser * @param definingClass * The class containing the type descriptor. * @return The parsed type descriptor or type signature. * @throws ParseException * If the type signature could not be parsed. */ static TypeSignature parse(final Parser parser, final String definingClass) throws ParseException { final ReferenceTypeSignature referenceTypeSignature = ReferenceTypeSignature .parseReferenceTypeSignature(parser, definingClass); if (referenceTypeSignature != null) { return referenceTypeSignature; } final BaseTypeSignature baseTypeSignature = BaseTypeSignature.parse(parser); if (baseTypeSignature != null) { return baseTypeSignature; } return null; }
} else if (peek == '+') { parser.expect('+'); final ReferenceTypeSignature typeSignature = ReferenceTypeSignature.parseReferenceTypeSignature(parser, definingClassName); if (typeSignature == null) { } else if (peek == '-') { parser.expect('-'); final ReferenceTypeSignature typeSignature = ReferenceTypeSignature.parseReferenceTypeSignature(parser, definingClassName); if (typeSignature == null) { final ReferenceTypeSignature typeSignature = ReferenceTypeSignature.parseReferenceTypeSignature(parser, definingClassName); if (typeSignature == null) {
parser.expect(':'); final ReferenceTypeSignature interfaceTypeSignature = ReferenceTypeSignature .parseReferenceTypeSignature(parser, definingClassName); if (interfaceTypeSignature == null) { throw new ParseException(parser, "Missing interface type signature");