public JavaField getXMLField(TypeSG pController, JavaSource pSource,
String pFieldName, String pDefaultValue) throws SAXException {
if (pSource.isInterface()) {
return null;
} else {
JavaQName runtimeType;
if (pController.isComplex() && 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();
}
JavaField jf = pSource.newJavaField(pFieldName, runtimeType, JavaSource.PRIVATE);
if (!pController.isComplex()) {
Object o = pController.getSimpleTypeSG().getInitialValue(pSource);
if (o == null && pDefaultValue != null) {
if (runtimeType.equals(StringSG.STRING_TYPE)) {
o = "\"" + pDefaultValue + "\"";
}
else {
o = pDefaultValue;
}