protected String getBuiltInStringQName() { String stringName = "string"; //$NON-NLS-1$ if (xsdSchema != null) { String schemaForSchemaPrefix = xsdSchema.getSchemaForSchemaQNamePrefix(); if (schemaForSchemaPrefix != null && schemaForSchemaPrefix.length() > 0) { String prefix = xsdSchema.getSchemaForSchemaQNamePrefix(); if (prefix != null && prefix.length() > 0) { stringName = prefix + ":" + stringName; //$NON-NLS-1$ } } } return stringName; }
public java.util.List getBuiltInTypeNamesList() { List items = new ArrayList(); if (xsdSchema != null) { String prefix = xsdSchema.getSchemaForSchemaQNamePrefix(); if (xsdSchema != null) { XSDSchema schemaForSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext();) { XSDTypeDefinition td = (XSDTypeDefinition) i.next(); String localName = td.getName(); String prefixedName = (prefix != null && prefix.length() > 0) ? prefix + ":" + localName : localName; items.add(prefixedName); } } } return items; }
@Override protected void copyAttributes() { XSDSchema ownerSchema = (XSDSchema)owner; XSDSchema copySchema = (XSDSchema)copy; copySchema.getQNamePrefixToNamespaceMap().putAll(ownerSchema.getQNamePrefixToNamespaceMap()); copySchema.setSchemaForSchemaQNamePrefix(ownerSchema.getSchemaForSchemaQNamePrefix()); super.copyAttributes(); } };
protected void createOtherSchema(EPackage ePackage) { XSDSchema otherSchema = XSDFactory.eINSTANCE.createXSDSchema(); otherSchema.setTargetNamespace(ePackage.getNsURI()); otherSchema.setSchemaForSchemaQNamePrefix("xsd"); Map<String, String> namespaces = otherSchema.getQNamePrefixToNamespaceMap(); namespaces.put(getUniqueNsPrefix(ePackage), otherSchema.getTargetNamespace()); namespaces.put(otherSchema.getSchemaForSchemaQNamePrefix(), XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); ePackageToXSDSchemaMap.put(ePackage, otherSchema); // map(otherSchema, ePackage); }
protected void createOtherSchema(EPackage ePackage) { XSDSchema otherSchema = XSDFactory.eINSTANCE.createXSDSchema(); otherSchema.setTargetNamespace(ePackage.getNsURI()); otherSchema.setSchemaForSchemaQNamePrefix("xsd"); Map<String, String> namespaces = otherSchema.getQNamePrefixToNamespaceMap(); namespaces.put(getUniqueNsPrefix(ePackage), otherSchema.getTargetNamespace()); namespaces.put(otherSchema.getSchemaForSchemaQNamePrefix(), XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); ePackageToXSDSchemaMap.put(ePackage, otherSchema); // map(otherSchema, ePackage); }
String qualifier = xsdSchema.getSchemaForSchemaQNamePrefix(); String schemaForSchemaNamespace = xsdSchema.getSchemaForSchemaNamespace();
String qualifier = xsdSchema.getSchemaForSchemaQNamePrefix(); String schemaForSchemaNamespace = xsdSchema.getSchemaForSchemaNamespace();
protected void createSchema() { xsdSchema = XSDFactory.eINSTANCE.createXSDSchema(); addOutput(xsdSchema); // addInput(xsdSchema); xsdSchema.setTargetNamespace(ePackage.getNsURI()); xsdSchema.setSchemaForSchemaQNamePrefix("xsd"); Map<String, String> namespaces = xsdSchema.getQNamePrefixToNamespaceMap(); namespaces.put(getUniqueNsPrefix(ePackage), xsdSchema.getTargetNamespace()); namespaces.put(xsdSchema.getSchemaForSchemaQNamePrefix(), XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); map(xsdSchema, ePackage); }
protected void createSchema() { xsdSchema = XSDFactory.eINSTANCE.createXSDSchema(); addOutput(xsdSchema); // addInput(xsdSchema); xsdSchema.setTargetNamespace(ePackage.getNsURI()); xsdSchema.setSchemaForSchemaQNamePrefix("xsd"); Map<String, String> namespaces = xsdSchema.getQNamePrefixToNamespaceMap(); namespaces.put(getUniqueNsPrefix(ePackage), xsdSchema.getTargetNamespace()); namespaces.put(xsdSchema.getSchemaForSchemaQNamePrefix(), XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); map(xsdSchema, ePackage); }
String xsdForXSDPrefix = xsdSchema.getSchemaForSchemaQNamePrefix(); Map map = xsdSchema.getQNamePrefixToNamespaceMap();
protected void createEMFSchema() { emfSchema = XSDFactory.eINSTANCE.createXSDSchema(); emfSchema.setTargetNamespace(EMF_SCHEMA_URI); emfSchema.setSchemaForSchemaQNamePrefix("xsd"); Map<String, String> namespaces = emfSchema.getQNamePrefixToNamespaceMap(); namespaces.put(EMF_SCHEMA_PREFIX, emfSchema.getTargetNamespace()); namespaces.put(emfSchema.getSchemaForSchemaQNamePrefix(), XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); XSDSimpleTypeDefinition list = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition(); list.setName(REFERENCE_TYPE_NAME); XSDSimpleTypeDefinition union = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition(); union.getMemberTypeDefinitions().add(emfSchema.getSchemaForSchema().resolveSimpleTypeDefinition("IDREF")); union.getMemberTypeDefinitions().add(emfSchema.getSchemaForSchema().resolveSimpleTypeDefinition("QName")); union.getMemberTypeDefinitions().add(emfSchema.getSchemaForSchema().resolveSimpleTypeDefinition("anyURI")); list.setItemTypeDefinition(union); list.getContents().add(union); emfSchema.getContents().add(list); }
Map<String, String> namespaces = schema.getQNamePrefixToNamespaceMap(); namespaces.put(targetPrefix, schema.getTargetNamespace()); namespaces.put(schema.getSchemaForSchemaQNamePrefix(), XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
protected void createEMFSchema() { emfSchema = XSDFactory.eINSTANCE.createXSDSchema(); emfSchema.setTargetNamespace(EMF_SCHEMA_URI); emfSchema.setSchemaForSchemaQNamePrefix("xsd"); Map<String, String> namespaces = emfSchema.getQNamePrefixToNamespaceMap(); namespaces.put(EMF_SCHEMA_PREFIX, emfSchema.getTargetNamespace()); namespaces.put(emfSchema.getSchemaForSchemaQNamePrefix(), XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); XSDSimpleTypeDefinition list = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition(); list.setName(REFERENCE_TYPE_NAME); XSDSimpleTypeDefinition union = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition(); union.getMemberTypeDefinitions().add(emfSchema.getSchemaForSchema().resolveSimpleTypeDefinition("IDREF")); union.getMemberTypeDefinitions().add(emfSchema.getSchemaForSchema().resolveSimpleTypeDefinition("QName")); union.getMemberTypeDefinitions().add(emfSchema.getSchemaForSchema().resolveSimpleTypeDefinition("anyURI")); list.setItemTypeDefinition(union); list.getContents().add(union); emfSchema.getContents().add(list); }
Map<String, String> namespaces = schema.getQNamePrefixToNamespaceMap(); namespaces.put(targetPrefix, schema.getTargetNamespace()); namespaces.put(schema.getSchemaForSchemaQNamePrefix(), XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
if (ftSchema.getSchemaForSchemaQNamePrefix() != null) { schema.setSchemaForSchemaQNamePrefix(ftSchema.getSchemaForSchemaQNamePrefix());
public Element createElement() { if (schema == null) // kb Note: This case is not supposed to happen. { // cs ... why do we do this if its not supposed to happen? // Is there a scenario where this is a usefull fallback? // Under what conditions does this code get executed (i.e. why would schema == null)? schema = XSDFactory.eINSTANCE.createXSDSchema(); schema.setSchemaForSchemaQNamePrefix("xsd"); schema.setTargetNamespace("http://tempuri.org/"); java.util.Map qNamePrefixToNamespaceMap = schema.getQNamePrefixToNamespaceMap(); qNamePrefixToNamespaceMap.put("", schema.getTargetNamespace()); qNamePrefixToNamespaceMap.put(schema.getSchemaForSchemaQNamePrefix(), org.eclipse.xsd.util.XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); adopt(schema); schema.updateElement(true); return schema.getElement(); } else { element = schema.getElement(); if (element == null) { adopt(schema); schema.updateElement(true); element = schema.getElement(); } return element; } }
if (schema.getSchemaForSchemaQNamePrefix() == null)
qNamePrefixToNamespaceMap.put(prototypeSchema.getSchemaForSchemaQNamePrefix(), /*{@link */XSDConstants/*}*/.SCHEMA_FOR_SCHEMA_URI_2001); qNamePrefixToNamespaceMap.put("EXT", /*{@link #*/someOtherSchemaURI/*}*/);
qNamePrefixToNamespaceMap.put(prototypeSchema.getSchemaForSchemaQNamePrefix(), /*{@link */XSDConstants/*}*/.SCHEMA_FOR_SCHEMA_URI_2001); qNamePrefixToNamespaceMap.put("EXT", /*{@link #*/someOtherSchemaURI/*}*/);
qNamePrefixToNamespaceMap.put(xsdSchema.getSchemaForSchemaQNamePrefix(), /*{@link */XSDConstants/*}*/.SCHEMA_FOR_SCHEMA_URI_2001);