for (Iterator i = identityFields.iterator (); i.hasNext ();) {
FieldInfo field = (FieldInfo) i.next ();
String fieldName = field.getName ();
MethodInfo method = objectClassInfo.getGetterMethod (fieldName, true);
// Make sure that the method has no extra parameters.
List parameters = method.getParameters ();
if (parameters.size () != 0) {
throw new IllegalStateException ("Getter method has wrong number"
+ " of parameters");
}
// Write the getter method comment.
GenerateUtilities.writeJavaDocComment (out, " ", method.getComment ());
// Write the getter method declaration.
out.println (" public " + method.getReturnTypeName () + " "
+ method.getName () + " () {");
// Write the method body.
out.println (" return " + fieldName + ";");
// Write the method close.