for (Iterator i = mockableClass.getNormalMethods().iterator(); i.hasNext();) {
MockableMethod method = (MockableMethod) i.next();
out("\n");
Type returnType = method.getReturnType();
final String returnTypeStr =
CodeUtils.fixInnerClassName(returnType.toString());
out(" public ").out(returnTypeStr).out(" ").out(method.getName()).out("(").out(declareParameters(method, "")).out(") ").out(throwsClause(method)).out("{\n");
String bindSignature = method.getBindSignature();
List parameters = method.getParameters();
if (bindSignature.equals("equals(java.lang.Object)")) {
out(" return com.volantis.testtools.mock.generated.GeneratedHelper.equalsMock(this, configuration, ").out(((MockableParameter) parameters.get(0)).getName()).out(");\n");
} else if (bindSignature.equals("hashCode()")) {
out(" return com.volantis.testtools.mock.generated.GeneratedHelper.hashCodeMock(this, configuration);\n");
} else if (bindSignature.equals("toString()")) {
out(" return com.volantis.testtools.mock.generated.GeneratedHelper.toStringMock(this, configuration);\n");
} else {
out(" com.volantis.testtools.mock.method.MethodCall _call = _mockFactory.createMethodCall(\n");
out(" this, ").out(method.getUniqueIdentifier()).out(",\n");
if (parameters != null) {
out(" new java.lang.Object[]{\n");
for (Iterator j = parameters.iterator(); j.hasNext();) {
MockableParameter parameter = (MockableParameter) j.next();
out(" ").out(parameter.box()).out(",\n");
}
out(" });\n");
} else {
out(" null);\n");
}
out("\n");
out(" try {\n");
if (returnType.toString().equals("void")) {
out(" _doMethodCall(_call);\n");
} else {
out(" java.lang.Object _result = _doMethodCall(_call);\n");
out(" return ").out(method.unbox(returnType, "_result")).out(";\n");
}