/** * Create and return a ComplexType containing simple content for a given XMLDescriptor. Assumes * that the descriptor has a schema context set. * * @param desc * @param schemaForNamespace * @param workingSchema * @param properties * @param descriptors * @return */ private ComplexType buildComplexTypeWithSimpleContent(Descriptor desc, HashMap<String, Schema> schemaForNamespace, Schema workingSchema, SchemaModelGeneratorProperties properties, List<Descriptor> descriptors) { ComplexType ct = new ComplexType(); SimpleContent sc = new SimpleContent(); Extension extension = new Extension(); sc.setExtension(extension); ct.setSimpleContent(sc); for (CoreMapping mapping : (Vector<CoreMapping>)desc.getMappings()) { Field xFld = (Field) mapping.getField(); if (xFld.getXPath().equals(TEXT)) { extension.setBaseType(getSchemaTypeForDirectMapping((DirectMapping) mapping, workingSchema)); } else if (xFld.getXPathFragment().isAttribute()) { String schemaTypeString = getSchemaTypeForDirectMapping((DirectMapping) mapping, workingSchema); Attribute attr = buildAttribute((DirectMapping) mapping, schemaTypeString); extension.getOrderedAttributes().add(attr); } } return ct; }
/** * Create and return a ComplexType containing simple content for a given XMLDescriptor. Assumes * that the descriptor has a schema context set. * * @param desc * @param schemaForNamespace * @param workingSchema * @param properties * @param descriptors * @return */ private ComplexType buildComplexTypeWithSimpleContent(XMLDescriptor desc, HashMap<String, Schema> schemaForNamespace, Schema workingSchema, SchemaModelGeneratorProperties properties, List<XMLDescriptor> descriptors) { ComplexType ct = new ComplexType(); SimpleContent sc = new SimpleContent(); Extension extension = new Extension(); sc.setExtension(extension); ct.setSimpleContent(sc); for (DatabaseMapping mapping : desc.getMappings()) { XMLField xFld = (XMLField) mapping.getField(); if (xFld.getXPath().equals(TEXT)) { extension.setBaseType(getSchemaTypeForDirectMapping((XMLDirectMapping) mapping, workingSchema)); } else if (xFld.getXPathFragment().isAttribute()) { String schemaTypeString = getSchemaTypeForDirectMapping((XMLDirectMapping) mapping, workingSchema); Attribute attr = buildAttribute((XMLDirectMapping) mapping, schemaTypeString); extension.getOrderedAttributes().add(attr); } } return ct; }
/** * Create and return a ComplexType containing simple content for a given XMLDescriptor. Assumes * that the descriptor has a schema context set. * * @param desc * @param schemaForNamespace * @param workingSchema * @param properties * @param descriptors * @return */ private ComplexType buildComplexTypeWithSimpleContent(Descriptor desc, HashMap<String, Schema> schemaForNamespace, Schema workingSchema, SchemaModelGeneratorProperties properties, List<Descriptor> descriptors) { ComplexType ct = new ComplexType(); SimpleContent sc = new SimpleContent(); Extension extension = new Extension(); sc.setExtension(extension); ct.setSimpleContent(sc); for (CoreMapping mapping : (Vector<CoreMapping>)desc.getMappings()) { Field xFld = (Field) mapping.getField(); if (xFld.getXPath().equals(TEXT)) { extension.setBaseType(getSchemaTypeForDirectMapping((DirectMapping) mapping, workingSchema)); } else if (xFld.getXPathFragment().isAttribute()) { String schemaTypeString = getSchemaTypeForDirectMapping((DirectMapping) mapping, workingSchema); Attribute attr = buildAttribute((DirectMapping) mapping, schemaTypeString); extension.getOrderedAttributes().add(attr); } } return ct; }
extension.setBaseType(extensionTypeName); content.setExtension(extension); type.setSimpleContent(content); info.setComplexType(type); } else {
extension.setBaseType(extensionTypeName); content.setExtension(extension); type.setSimpleContent(content); info.setComplexType(type); } else {
if(type != null) { ComplexType cType = new ComplexType(); cType.setSimpleContent(new SimpleContent()); Extension extension = new Extension(); extension.setBaseType(type.getRestriction().getBaseType()); extension.setBaseType(eType); sContent.setExtension(extension); cType.setSimpleContent(sContent); currentElement.setType(null); currentElement.setComplexType(cType); if(type != null) { ComplexType cType = new ComplexType(); cType.setSimpleContent(new SimpleContent()); Extension extension = new Extension(); extension.setBaseType(type.getRestriction().getBaseType()); extension.setBaseType(eType); sContent.setExtension(extension); cType.setSimpleContent(sContent); currentElement.setType(null); currentElement.setComplexType(cType);
if(type != null) { ComplexType cType = new ComplexType(); cType.setSimpleContent(new SimpleContent()); Extension extension = new Extension(); extension.setBaseType(type.getRestriction().getBaseType()); extension.setBaseType(eType); sContent.setExtension(extension); cType.setSimpleContent(sContent); currentElement.setType(null); currentElement.setComplexType(cType); if(type != null) { ComplexType cType = new ComplexType(); cType.setSimpleContent(new SimpleContent()); Extension extension = new Extension(); extension.setBaseType(type.getRestriction().getBaseType()); extension.setBaseType(eType); sContent.setExtension(extension); cType.setSimpleContent(sContent); currentElement.setType(null); currentElement.setComplexType(cType);
SimpleContent content = new SimpleContent(); content.setExtension(extension); type.setSimpleContent(content); return type; }else{
SimpleContent content = new SimpleContent(); content.setExtension(extension); type.setSimpleContent(content); return type; }else{