public JavaMethod getXMLSetMethod(TypeSG pController, JavaSource pSource,
String pFieldName, String pParamName,
String pMethodName,
boolean pSetIsSet) throws SAXException {
if (pController.isComplex()) {
JavaMethod jm = pSource.newJavaMethod(pMethodName, JavaQNameImpl.VOID, JavaSource.PUBLIC);
JavaQName runtimeType;
if (pFieldName.equals("value") && pController.getComplexTypeSG().hasSimpleContent()) {
SimpleContentSG obj = pController.getComplexTypeSG().getSimpleContentSG();
runtimeType = obj.getContentTypeSG().getRuntimeType();
if (pController.isRestriction()) {
if (pController.getRestrictedType().isExtension()) {
runtimeType = pController.getRestrictedType().getExtendedType().getRuntimeType();
}
}
}
else {
runtimeType = pController.getRuntimeType();
}
DirectAccessible param = jm.addParam(runtimeType, pParamName);
if (!pSource.isInterface()) {
jm.addLine(pFieldName, " = ", param, ";");
}
return jm;
} else {
JavaMethod jm = pController.getSimpleTypeSG().getXMLSetMethod(pSource, pFieldName, pParamName, pMethodName);
if (pSetIsSet && pController.getRuntimeType().isPrimitive()) {
jm.addLine(getIsSetCheckFieldName(pFieldName), " = true;");
}
return jm;
}
}