ParticleSG[] myParticles = pController.getParticles();
JavaMethod jm = null;
LocalJavaField pElement = null;
XMLSerializersMarshalChildsSGlet sgLet = null;
for (int i = 0; i < myParticles.length; i++) {
ParticleSG particle = myParticles[i];
if (jm == null) {
jm = pSource.newJavaMethod("marshalChilds", JavaQNameImpl.VOID, JavaSource.PROTECTED);
DirectAccessible pData = jm.addParam(JavaQNameImpl.getInstance(JMXmlSerializer.Data.class), "pData");
sgLet = new XMLSerializersMarshalChildsSGlet(pData);
JavaQName elementInterface = pController.getClassContext().getXMLInterfaceName();
DirectAccessible pObject = jm.addParam(Object.class, "pObject");
pElement = jm.newJavaField(elementInterface);
pElement.addLine("(", elementInterface, ") ", pObject);
jm.addThrows(SAXException.class);
}
if (!particle.isElement()) {
// TODO: Implement handling for wildcards and subgroups
//throw new IllegalStateException("Wildcards and subgroups are not implemented.");
return jm;
}
sgLet.setChild(particle);
sgLet.setFieldName(getXMLSerializersFieldName(particle.getPropertySG()));
particle.getPropertySG().forAllNonNullValues(jm, pElement, sgLet);
}
log.finest(mName, "<-");
return jm;
}