use of org.eclipse.persistence.internal.oxm.schema.model.ComplexType in project eclipselink by eclipse-ee4j.
the class SDOTypesGenerator method processGlobalComplexTypes.
private void processGlobalComplexTypes(Schema schema) {
Collection<ComplexType> complexTypes = schema.getTopLevelComplexTypes().values();
if (complexTypes == null) {
return;
}
Iterator<ComplexType> complexTypesIter = complexTypes.iterator();
while (complexTypesIter.hasNext()) {
ComplexType complexType = complexTypesIter.next();
String targetNamespace = schema.getTargetNamespace();
if (null == targetNamespace) {
targetNamespace = "";
}
processGlobalComplexType(targetNamespace, schema.getDefaultNamespace(), complexType);
}
}
use of org.eclipse.persistence.internal.oxm.schema.model.ComplexType in project eclipselink by eclipse-ee4j.
the class SDOTypesGenerator method preprocessGlobalTypes.
private void preprocessGlobalTypes(Schema schema) {
String targetNamespace = schema.getTargetNamespace();
// Global Complex Types
Collection<ComplexType> globalComplexTypes = schema.getTopLevelComplexTypes().values();
for (ComplexType globalComplexType : globalComplexTypes) {
QName xsdQName = new QName(targetNamespace, globalComplexType.getName());
SDOType sdoType = preprocessComplexType(globalComplexType, schema);
sdoType.setXsdType(xsdQName);
generatedTypesByXsdQName.put(xsdQName, sdoType);
}
// Global Simple Types
Collection<SimpleType> globalSimpleTypes = schema.getTopLevelSimpleTypes().values();
for (SimpleType globalSimpleType : globalSimpleTypes) {
QName xsdQName = new QName(targetNamespace, globalSimpleType.getName());
SDOType sdoType = preprocessSimpleType(globalSimpleType, schema);
sdoType.setXsdType(xsdQName);
generatedTypesByXsdQName.put(xsdQName, sdoType);
}
}
use of org.eclipse.persistence.internal.oxm.schema.model.ComplexType in project eclipselink by eclipse-ee4j.
the class SDOTypesGenerator method processGlobalComplexType.
private void processGlobalComplexType(String targetNamespace, String defaultNamespace, ComplexType complexType) {
QName qname = new QName(targetNamespace, complexType.getName());
ComplexType processed = processedComplexTypes.get(qname);
if (processed == null) {
processComplexType(targetNamespace, defaultNamespace, complexType.getName(), complexType);
processedComplexTypes.put(qname, complexType);
}
}
use of org.eclipse.persistence.internal.oxm.schema.model.ComplexType in project eclipselink by eclipse-ee4j.
the class SDOTypesGenerator method processExtension.
private void processExtension(String targetNamespace, String defaultNamespace, SDOType owningType, Extension extension, boolean simpleContent) {
if (extension != null) {
String qualifiedType = extension.getBaseType();
SDOType baseType = getSDOTypeForName(targetNamespace, defaultNamespace, qualifiedType);
QName baseQName = getQNameForString(defaultNamespace, qualifiedType);
if (baseType != null) {
if (!baseType.isFinalized() && baseQName.getNamespaceURI().equals(targetNamespace)) {
if (baseType.isDataType()) {
SimpleType baseSimpleType = rootSchema.getTopLevelSimpleTypes().get(baseQName.getLocalPart());
if (baseSimpleType != null) {
processGlobalSimpleType(targetNamespace, defaultNamespace, baseSimpleType);
}
} else {
ComplexType baseComplexType = rootSchema.getTopLevelComplexTypes().get(baseQName.getLocalPart());
if (baseComplexType != null) {
processGlobalComplexType(targetNamespace, defaultNamespace, baseComplexType);
}
}
}
owningType.setOpen(owningType.isOpen() || baseType.isOpen());
}
if (qualifiedType != null) {
processBaseType(baseType, targetNamespace, defaultNamespace, owningType, qualifiedType, simpleContent);
}
if (extension.getChoice() != null) {
processChoice(targetNamespace, defaultNamespace, owningType, extension.getChoice(), false);
} else if (extension.getSequence() != null) {
processSequence(targetNamespace, defaultNamespace, owningType, extension.getSequence(), false);
} else if (extension.getAll() != null) {
}
processOrderedAttributes(targetNamespace, defaultNamespace, owningType, extension.getOrderedAttributes());
}
}
use of org.eclipse.persistence.internal.oxm.schema.model.ComplexType in project eclipselink by eclipse-ee4j.
the class Util method addSimpleXMLFormat.
/*
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<xsd:complexType name="simple-xml-format">
<xsd:sequence>
<xsd:any minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
*/
public static void addSimpleXMLFormat(Schema schema) {
ComplexType anyType = new ComplexType();
anyType.setName(DEFAULT_SIMPLE_XML_FORMAT_TAG);
Sequence anySequence = new Sequence();
Any any = new Any();
any.setMinOccurs("0");
anySequence.addAny(any);
anyType.setSequence(anySequence);
schema.addTopLevelComplexTypes(anyType);
}
Aggregations