);
jaxbCollection.annotate( XmlAccessorType.class ).param( VALUE, XmlAccessType.FIELD );
JClass stubsListType = codeGenerator.ref( List.class ).narrow( jaxbStub );
JFieldVar stubsField = jaxbCollection.field( JMod.PRIVATE, stubsListType, pluralName );
stubsField.annotate( XmlElementRef.class );
addGetter( jaxbCollection, stubsListType, stubsField, stubsField.name() );
addSetter( jaxbCollection, stubsListType, stubsField, stubsField.name() );
//Add constructors
jaxbCollection.constructor( JMod.PUBLIC );
{
JMethod constructor = jaxbCollection.constructor( JMod.PUBLIC );
JVar stubsParam = constructor.param( stubsListType, stubsField.name() );
constructor.body().invoke( "this" ).arg( stubsParam ).arg( JExpr.lit( 0 ) ).arg( JExpr.lit( 0 ) );
}
{
JMethod constructor = jaxbCollection.constructor( JMod.PUBLIC );
JVar stubsParam = constructor.param( stubsListType, stubsField.name() );
JVar startIndex = constructor.param( Integer.TYPE, "startIndex" );
JVar maxLength = constructor.param( Integer.TYPE, "maxLength" );
constructor.body().invoke( "super" ).arg( startIndex ).arg( maxLength );
constructor.body().assign( JExpr.refthis( stubsField.name() ), stubsParam );
}
}