Index: src/main/org/jibx/xsd2jibx/JSource.java =================================================================== RCS file: /cvsroot/jibx/xsd2jibx/src/main/org/jibx/xsd2jibx/JSource.java,v retrieving revision 1.6 diff -u -B -r1.6 JSource.java --- src/main/org/jibx/xsd2jibx/JSource.java 19 Feb 2005 20:02:31 -0000 1.6 +++ src/main/org/jibx/xsd2jibx/JSource.java 6 May 2007 21:16:33 -0000 @@ -89,6 +89,12 @@ jm.addParam(jqname, element.getFieldName()); jm.addLine(element.getFieldList() + ".add(" + element.getFieldName() + ");"); + // create add to position method: + jm = source.newJavaMethod(element.getAddPositionMethod(), JQName.VOID.getJavaQName(), PUBLIC); + jm.addParam(JQName.INT.getJavaQName(), "position"); + jm.addParam(jqname, element.getFieldName()); + jm.addLine(element.getFieldList() + ".add(position, " + element.getFieldName() + ");"); + // create getMethod jm = source.newJavaMethod(element.getGetMethod(), jqname, PUBLIC); jm.addParam(JQName.INT.getJavaQName(), "index"); @@ -97,6 +103,13 @@ //create size method jm = source.newJavaMethod(element.getSizeMethod(), JQName.INT.getJavaQName(), JavaSource.PUBLIC); jm.addLine("return " + element.getFieldList() + ".size();"); + + //create clear method + jm = source.newJavaMethod(element.getClearMethod(), JQName.VOID.getJavaQName(), JavaSource.PUBLIC); + jm.addLine(element.getFieldList() + ".clear();"); + //create unmodified method + jm = source.newJavaMethod(element.getListMethod(), "java.util.List", JavaSource.PUBLIC); + jm.addLine("return java.util.Collections.unmodifiableList("+element.getFieldList() + ");"); } else { // it is not a collection newBeanProperty(element); } Index: src/main/org/jibx/xsd2jibx/XsdElement.java =================================================================== RCS file: /cvsroot/jibx/xsd2jibx/src/main/org/jibx/xsd2jibx/XsdElement.java,v retrieving revision 1.6 diff -u -B -r1.6 XsdElement.java --- src/main/org/jibx/xsd2jibx/XsdElement.java 19 Feb 2005 20:02:31 -0000 1.6 +++ src/main/org/jibx/xsd2jibx/XsdElement.java 6 May 2007 21:16:33 -0000 @@ -60,6 +60,12 @@ return sb.toString(); } + public String getAddPositionMethod() { + StringBuffer sb = new StringBuffer("addAt"); + sb.append(NameUtil.toUpperCamelCase(getJavaName())); + return sb.toString(); + } + public String getSizeMethod() { StringBuffer sb = new StringBuffer("size"); sb.append(NameUtil.toUpperCamelCase(getJavaName())); @@ -67,6 +73,19 @@ return sb.toString(); } + public String getClearMethod() { + StringBuffer sb = new StringBuffer("clear"); + sb.append(NameUtil.toUpperCamelCase(getJavaName())); + sb.append(NameUtil.addListSuffix); + return sb.toString(); + } + public String getListMethod() { + StringBuffer sb = new StringBuffer("getList"); + sb.append(NameUtil.toUpperCamelCase(getJavaName())); + sb.append(NameUtil.addListSuffix); + return sb.toString(); + } + protected void importRef() { if (this.ref != null) {