private void processSimpleContent(String targetNamespace, String defaultNamespace, SimpleContent simpleContent, SDOType owningType) { if (simpleContent != null) { if (simpleContent.getExtension() != null) { processExtension(targetNamespace, defaultNamespace, owningType, simpleContent.getExtension(), true); } else { if (simpleContent.getRestriction() != null) { processRestriction(targetNamespace, defaultNamespace, owningType, simpleContent.getRestriction()); } } } }
public void setSimpleContent(SimpleContent simpleContent) { if (simpleContent != null) { simpleContent.setOwner(this); } this.simpleContent = simpleContent; }
/** * 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 an attribute reference and add it to a given complex type. * This method will typically be called when processing an XPath * and a prefixed path element is encountered that requires an * attribute ref. * * @param attributeRefName * @param owningComplexType * @return */ public Attribute createRefAttribute(String attributeRefName, ComplexType owningComplexType) { Attribute refAttribute = new Attribute(); refAttribute.setRef(attributeRefName); if (owningComplexType.getSimpleContent() != null) { owningComplexType.getSimpleContent().getExtension().getOrderedAttributes().add(refAttribute); } else { owningComplexType.getOrderedAttributes().add(refAttribute); } return refAttribute; }
/** * 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 an attribute reference and add it to a given complex type. * This method will typically be called when processing an XPath * and a prefixed path element is encountered that requires an * attribute ref. * * @param attributeRefName * @param owningComplexType * @return */ public Attribute createRefAttribute(String attributeRefName, ComplexType owningComplexType) { Attribute refAttribute = new Attribute(); refAttribute.setRef(attributeRefName); if (owningComplexType.getSimpleContent() != null) { owningComplexType.getSimpleContent().getExtension().getOrderedAttributes().add(refAttribute); } else { owningComplexType.getOrderedAttributes().add(refAttribute); } return refAttribute; }
/** * 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; }
private void processSimpleContent(String targetNamespace, String defaultNamespace, SimpleContent simpleContent, SDOType owningType) { if (simpleContent != null) { if (simpleContent.getExtension() != null) { processExtension(targetNamespace, defaultNamespace, owningType, simpleContent.getExtension(), true); } else { if (simpleContent.getRestriction() != null) { processRestriction(targetNamespace, defaultNamespace, owningType, simpleContent.getRestriction()); } } } }
type.getSimpleContent().getExtension().getOrderedAttributes().add(reference); } else { type.getOrderedAttributes().add(reference); type.getSimpleContent().getExtension().getOrderedAttributes().add(attribute); } else if (type.getComplexContent() != null) { type.getComplexContent().getExtension().getOrderedAttributes().add(attribute);
public void setSimpleContent(SimpleContent simpleContent) { if (simpleContent != null) { simpleContent.setOwner(this); } this.simpleContent = simpleContent; }
} else if ((valueField = this.getXmlValueFieldForSimpleContent(info)) != null) { ComplexType type = new ComplexType(); SimpleContent content = new SimpleContent(); if (EMPTY_STRING.equals(typeName)) { if (rootElement != null) { content.setExtension(extension); type.setSimpleContent(content); info.setComplexType(type);
/** * Convenience method for processing an any attribute property. Required * schema components will be generated and set accordingly. * * @param type the ComplexType which compositor(s) should be added to */ private void addAnyAttributeToSchema(ComplexType type) { AnyAttribute anyAttribute = new AnyAttribute(); anyAttribute.setProcessContents(SKIP); anyAttribute.setNamespace(Constants.ANY_NAMESPACE_OTHER); if (type.getSimpleContent() != null) { SimpleContent content = type.getSimpleContent(); if(content.getExtension() != null){ content.getExtension().setAnyAttribute(anyAttribute); }else if(content.getRestriction() != null){ content.getRestriction().setAnyAttribute(anyAttribute); } } else { type.setAnyAttribute(anyAttribute); } }
type.getSimpleContent().getExtension().getOrderedAttributes().add(reference); } else { type.getOrderedAttributes().add(reference); type.getSimpleContent().getExtension().getOrderedAttributes().add(attribute); } else if (type.getComplexContent() != null) { type.getComplexContent().getExtension().getOrderedAttributes().add(attribute);
public void setSimpleContent(SimpleContent simpleContent) { if (simpleContent != null) { simpleContent.setOwner(this); } this.simpleContent = simpleContent; }
} else if ((valueField = this.getXmlValueFieldForSimpleContent(info)) != null) { ComplexType type = new ComplexType(); SimpleContent content = new SimpleContent(); if (EMPTY_STRING.equals(typeName)) { if (rootElement != null) { content.setExtension(extension); type.setSimpleContent(content); info.setComplexType(type);
/** * Convenience method for processing an any attribute property. Required * schema components will be generated and set accordingly. * * @param type the ComplexType which compositor(s) should be added to */ private void addAnyAttributeToSchema(ComplexType type) { AnyAttribute anyAttribute = new AnyAttribute(); anyAttribute.setProcessContents(SKIP); anyAttribute.setNamespace(Constants.ANY_NAMESPACE_OTHER); if (type.getSimpleContent() != null) { SimpleContent content = type.getSimpleContent(); if(content.getExtension() != null){ content.getExtension().setAnyAttribute(anyAttribute); }else if(content.getRestriction() != null){ content.getRestriction().setAnyAttribute(anyAttribute); } } else { type.setAnyAttribute(anyAttribute); } }
if(type != null) { ComplexType cType = new ComplexType(); cType.setSimpleContent(new SimpleContent()); Extension extension = new Extension(); extension.setBaseType(type.getRestriction().getBaseType()); cType.getSimpleContent().setExtension(extension); currentElement.setSimpleType(null); currentElement.setComplexType(cType); String eType = currentElement.getType(); ComplexType cType = new ComplexType(); SimpleContent sContent = new SimpleContent(); Extension extension = new Extension(); extension.setBaseType(eType); sContent.setExtension(extension); cType.setSimpleContent(sContent); currentElement.setType(null); if(type != null) { ComplexType cType = new ComplexType(); cType.setSimpleContent(new SimpleContent()); Extension extension = new Extension(); extension.setBaseType(type.getRestriction().getBaseType()); cType.getSimpleContent().setExtension(extension); currentElement.setSimpleType(null); currentElement.setComplexType(cType); String eType = currentElement.getType(); ComplexType cType = new ComplexType();
SimpleContent content = new SimpleContent(); content.setExtension(extension); type.setSimpleContent(content); return type;
SimpleContent content = new SimpleContent(); content.setExtension(extension); type.setSimpleContent(content); return type;
if(type != null) { ComplexType cType = new ComplexType(); cType.setSimpleContent(new SimpleContent()); Extension extension = new Extension(); extension.setBaseType(type.getRestriction().getBaseType()); cType.getSimpleContent().setExtension(extension); currentElement.setSimpleType(null); currentElement.setComplexType(cType); String eType = currentElement.getType(); ComplexType cType = new ComplexType(); SimpleContent sContent = new SimpleContent(); Extension extension = new Extension(); extension.setBaseType(eType); sContent.setExtension(extension); cType.setSimpleContent(sContent); currentElement.setType(null); if(type != null) { ComplexType cType = new ComplexType(); cType.setSimpleContent(new SimpleContent()); Extension extension = new Extension(); extension.setBaseType(type.getRestriction().getBaseType()); cType.getSimpleContent().setExtension(extension); currentElement.setSimpleType(null); currentElement.setComplexType(cType); String eType = currentElement.getType(); ComplexType cType = new ComplexType();