if (xsd.resolveTypeDefinition(name.getNamespaceURI(), name.getLocalPart()) == null) { xsd.resolveTypeDefinition(name.getNamespaceURI(), name.getLocalPart()); attribute.setTypeDefinition(attributeDefinition);
protected XSDComponent getDefinedComponent(XSDSchema schema, String componentName, String componentNamespace) { XSDTypeDefinition result = schema.resolveTypeDefinition(componentNamespace, componentName); if (result.eContainer() == null) { result = null; } return result; }
public XSDTypeDefinition resolveTypeDefinition(String namespace, String localName) { XSDSchema xsdSchema = getSchema(); if (xsdSchema != null) { return xsdSchema.resolveTypeDefinition(namespace, localName); } else { return createUnresolvedTypeDefinition(namespace, localName); } }
public XSDTypeDefinition resolveTypeDefinition(String namespace, String localName) { XSDSchema xsdSchema = getSchema(); if (xsdSchema != null) { return xsdSchema.resolveTypeDefinition(namespace, localName); } else { return createUnresolvedTypeDefinition(namespace, localName); } }
public XSDTypeDefinition resolveTypeDefinition(String localName) { XSDSchema xsdSchema = getSchema(); if (xsdSchema != null) { return xsdSchema.resolveTypeDefinition(xsdSchema.getTargetNamespace(), localName); } else { return createUnresolvedTypeDefinition(null, localName); } }
public XSDTypeDefinition resolveTypeDefinition(String localName) { XSDSchema xsdSchema = getSchema(); if (xsdSchema != null) { return xsdSchema.resolveTypeDefinition(xsdSchema.getTargetNamespace(), localName); } else { return createUnresolvedTypeDefinition(null, localName); } }
protected XSDComplexTypeDefinition createExtendedComplexTypeDefinition(XSDSchema schema, String name, String extension) { XSDComplexTypeDefinition complexType = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition(); complexType.setName(name); complexType.setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL); complexType.setBaseTypeDefinition(schema.resolveTypeDefinition(extension)); return complexType; }
protected XSDComplexTypeDefinition createExtendedComplexTypeDefinition(XSDSchema schema, String name, String extension) { XSDComplexTypeDefinition complexType = XSDFactory.eINSTANCE.createXSDComplexTypeDefinition(); complexType.setName(name); complexType.setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL); complexType.setBaseTypeDefinition(schema.resolveTypeDefinition(extension)); return complexType; }
public void visitSchema(XSDSchema schema) { if (segment != null) { if (segment.kind == PathSegment.ELEMENT) { XSDElementDeclaration ed = schema.resolveElementDeclaration(segment.name); if (ed != null) { visitElementDeclaration(ed); } } else if (segment.kind == PathSegment.TYPE) { XSDTypeDefinition td = schema.resolveTypeDefinition(segment.name); if (td != null) { visitTypeDefinition(td); } } } }
protected XSDTypeDefinition typeInOtherSchema(EClassifier classifier) { EPackage typePkg = classifier.getEPackage(); Map<String, String> namespaces = xsdSchema.getQNamePrefixToNamespaceMap(); String nsPrefix = getUniqueNsPrefix(typePkg); if (namespaces.get(nsPrefix) == null) { namespaces.put(nsPrefix, typePkg.getNsURI()); addImport(typePkg.getNsURI(), getName(typePkg) + ".xsd"); createOtherSchema(typePkg); } XSDSchema otherXSDSchema = ePackageToXSDSchemaMap.get(typePkg); return otherXSDSchema.resolveTypeDefinition(getName(classifier)); }
protected XSDTypeDefinition typeInOtherSchema(EClassifier classifier) { EPackage typePkg = classifier.getEPackage(); Map<String, String> namespaces = xsdSchema.getQNamePrefixToNamespaceMap(); String nsPrefix = getUniqueNsPrefix(typePkg); if (namespaces.get(nsPrefix) == null) { namespaces.put(nsPrefix, typePkg.getNsURI()); addImport(typePkg.getNsURI(), getName(typePkg) + ".xsd"); createOtherSchema(typePkg); } XSDSchema otherXSDSchema = ePackageToXSDSchemaMap.get(typePkg); return otherXSDSchema.resolveTypeDefinition(getName(classifier)); }
XSDTypeDefinition resolveTypeInSchema(XSDSchema schema, Name typeName) { XSDTypeDefinition type = null; for (XSDTypeDefinition td : (schema.getTypeDefinitions())) { if (typeName.getNamespaceURI().equals(td.getTargetNamespace()) && typeName.getLocalPart().equals(td.getName())) { type = td; break; } } if (type == null) { type = schema.resolveTypeDefinition( typeName.getNamespaceURI(), typeName.getLocalPart()); } return type; }
@Override public XSDTypeDefinition resolveTypeDefinition(String namespace, String localName) { XSDTypeDefinition result = (XSDTypeDefinition)resolveNamedComponent(XSDPackage.Literals.XSD_SCHEMA__TYPE_DEFINITIONS, namespace, localName); if (result == null && XSDConstants.isSchemaForSchemaNamespace(namespace) && !XSDConstants.isSchemaForSchemaNamespace(getTargetNamespace())) { result = getSchemaForSchema(namespace).resolveTypeDefinition(namespace, localName); } if (result == null) { result = createUnresolvedTypeDefinition(namespace, localName); } return result; }
schema.resolveTypeDefinition(namespace, localName);
@Override public XSDTypeDefinition resolveTypeDefinition(String namespace, String localName) { XSDTypeDefinition result = (XSDTypeDefinition)resolveNamedComponent(XSDPackage.Literals.XSD_SCHEMA__TYPE_DEFINITIONS, namespace, localName); if (result == null && XSDConstants.isSchemaForSchemaNamespace(namespace) && !XSDConstants.isSchemaForSchemaNamespace(getTargetNamespace())) { result = getSchemaForSchema(namespace).resolveTypeDefinition(namespace, localName); } if (result == null) { result = createUnresolvedTypeDefinition(namespace, localName); } return result; }
protected void setReferenceElementType(EReference reference, XSDElementDeclaration xsdElementDeclaration) { if (reference.getEType() != null) { XSDTypeDefinition type; if (reference.getEType().getEPackage() == ePackage) { type = xsdSchema.resolveTypeDefinition(getName(reference.getEType())); } else { type = typeInOtherSchema(reference.getEType()); } if (type != null) { xsdElementDeclaration.setTypeDefinition(type); } } }
protected void setReferenceElementType(EReference reference, XSDElementDeclaration xsdElementDeclaration) { if (reference.getEType() != null) { XSDTypeDefinition type; if (reference.getEType().getEPackage() == ePackage) { type = xsdSchema.resolveTypeDefinition(getName(reference.getEType())); } else { type = typeInOtherSchema(reference.getEType()); } if (type != null) { xsdElementDeclaration.setTypeDefinition(type); } } }
xsdComplexTypeDefinition.setBaseTypeDefinition(xsdSchema.resolveTypeDefinition(getName(superClass)));
protected void handleAnalysis() { if (!isElementDeclarationReference()) { XSDElementDeclaration theSubstitutionGroupAffiliation = getSubstitutionGroupAffiliation(); if (theSubstitutionGroupAffiliation != null && theSubstitutionGroupAffiliation.getContainer() != null) { ((XSDConcreteComponentImpl)theSubstitutionGroupAffiliation).analyze(); } XSDTypeDefinition theTypeDefinition = getTypeDefinition(); if (!isTypeExplicit || theTypeDefinition == null) { XSDTypeDefinition newTypeDefinition = theSubstitutionGroupAffiliation == null || theSubstitutionGroupAffiliation.getTypeDefinition() == null ? getSchema().getSchemaForSchema().resolveTypeDefinition("anyType") : theSubstitutionGroupAffiliation.getTypeDefinition(); if (newTypeDefinition != theTypeDefinition) { isTypeExplicit = false; setTypeDefinitionGen(newTypeDefinition); } } } super.analyze(); }
protected void handleAnalysis() { if (!isElementDeclarationReference()) { XSDElementDeclaration theSubstitutionGroupAffiliation = getSubstitutionGroupAffiliation(); if (theSubstitutionGroupAffiliation != null && theSubstitutionGroupAffiliation.getContainer() != null) { ((XSDConcreteComponentImpl)theSubstitutionGroupAffiliation).analyze(); } XSDTypeDefinition theTypeDefinition = getTypeDefinition(); if (!isTypeExplicit || theTypeDefinition == null) { XSDTypeDefinition newTypeDefinition = theSubstitutionGroupAffiliation == null || theSubstitutionGroupAffiliation.getTypeDefinition() == null ? getSchema().getSchemaForSchema().resolveTypeDefinition("anyType") : theSubstitutionGroupAffiliation.getTypeDefinition(); if (newTypeDefinition != theTypeDefinition) { isTypeExplicit = false; setTypeDefinitionGen(newTypeDefinition); } } } super.analyze(); }