/** * Checks whether the given word is a valid Java identifier and throws * a ParseException if it isn't. Wildcard characters are accepted. */ private void checkJavaIdentifier(String expectedDescription) throws ParseException { if (!isJavaIdentifier(nextWord)) { throw new ParseException("Expecting " + expectedDescription + " before " + reader.locationDescription()); } }
/** * Checks whether the given word is a valid Java identifier and throws * a ParseException if it isn't. Wildcard characters are accepted. */ private void checkJavaIdentifier(String expectedDescription, boolean allowGenerics) throws ParseException { if (!isJavaIdentifier(nextWord)) { throw new ParseException("Expecting " + expectedDescription + " before " + reader.locationDescription()); } if (!allowGenerics && containsGenerics(nextWord)) { throw new ParseException("Use of generics not allowed for " + expectedDescription + " at " + reader.locationDescription()); } }
/** * Checks whether the given word is a valid Java identifier and throws * a ParseException if it isn't. Wildcard characters are accepted. */ private void checkJavaIdentifier(String expectedDescription, boolean allowGenerics) throws ParseException { if (!isJavaIdentifier(nextWord)) { throw new ParseException("Expecting " + expectedDescription + " before " + reader.locationDescription()); } if (!allowGenerics && containsGenerics(nextWord)) { throw new ParseException("Use of generics not allowed for " + expectedDescription + " at " + reader.locationDescription()); } }
/** * Checks whether the given word is a valid Java identifier and throws * a ParseException if it isn't. Wildcard characters are accepted. */ private void checkJavaIdentifier(String expectedDescription, boolean allowGenerics) throws ParseException { if (!isJavaIdentifier(nextWord)) { throw new ParseException("Expecting " + expectedDescription + " before " + reader.locationDescription()); } if (!allowGenerics && containsGenerics(nextWord)) { throw new ParseException("Use of generics not allowed for " + expectedDescription + " at " + reader.locationDescription()); } }