protected final void createAddMethod(final CollectionInfo fieldInfo,
final JClass jClass) {
JMethod method = new JMethod(fieldInfo.getWriteMethodName());
method.addException(SGTypes.INDEX_OUT_OF_BOUNDS_EXCEPTION,
"if the index given is outside the bounds of the collection");
final JParameter parameter = new JParameter(fieldInfo.getContentType().getJType(),
fieldInfo.getContentName());
method.addParameter(parameter);
JSourceCode sourceCode = method.getSourceCode();
this.addMaxSizeCheck(fieldInfo, method.getName(), sourceCode);
sourceCode.add("this.");
sourceCode.append(fieldInfo.getName());
sourceCode.append(".add(");
sourceCode.append(fieldInfo.getContentType().createToJavaObjectCode(parameter.getName()));
sourceCode.append(");");
if (fieldInfo.isBound()) {
this.createBoundPropertyCode(fieldInfo, sourceCode);
}