private JavaMethod getXMLSerializersMarshalChildsMethod(GroupSG pController, JavaSource pSource) throws SAXException {
final String mName = "getXMLSerializersMarshalChildsMethod";
log.finest(mName, "->", pSource.getQName());
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 (!particle.isElement()) {
// TODO: Implement handling for wildcards and subgroups
throw new IllegalStateException("Wildcards and subgroups are not implemented.");
}
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);
}
sgLet.setChild(particle);
sgLet.setFieldName(getXMLSerializersFieldName(particle.getPropertySG()));