protected Collection find(Class c) { ArrayList found = new ArrayList(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; List content = schema.getContents(); for (Iterator itr = content.iterator(); itr.hasNext(); ) { Object o = itr.next(); if (c.isAssignableFrom(o.getClass())) { found.add(o); } } } return found; }
schema = (XSDSchema) queue.removeFirst(); List contents = schema.getContents();
schema = (XSDSchema) queue.removeFirst(); List contents = schema.getContents();
schema.getContents().add(imprt);
for (XSDSchemaContent content : schema.getContents()) { if (content instanceof XSDSchemaDirective) { XSDSchemaDirective directive = (XSDSchemaDirective) content;
gml.setSchemaLocation(baseURL.toString() + "/" + gmlLocation); gml.setResolvedSchema(gmlConfiguration.getXSD().getSchema()); xsd.getContents().add(gml); xsd.getContents().add(element); xsd.updateElement(); return xsd;
xsd.getContents().add(definition);
protected Collection find(Class c) { ArrayList found = new ArrayList(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; List content = schema.getContents(); for (Iterator itr = content.iterator(); itr.hasNext();) { Object o = itr.next(); if (c.isAssignableFrom(o.getClass())) { found.add(o); } } } return found; }
protected Collection find(Class c) { ArrayList found = new ArrayList(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; List content = schema.getContents(); for (Iterator itr = content.iterator(); itr.hasNext();) { Object o = itr.next(); if (c.isAssignableFrom(o.getClass())) { found.add(o); } } } return found; }
protected Collection find(Class c) { ArrayList found = new ArrayList(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; List content = schema.getContents(); for (Iterator itr = content.iterator(); itr.hasNext();) { Object o = itr.next(); if (c.isAssignableFrom(o.getClass())) { found.add(o); } } } return found; }
/** * Add include statement to schema. * * @param schema Output schema * @param factory XSD factory used to produce schema * @param schemaLocation The schema location to be included */ private void addInclude(XSDSchema schema, XSDFactory factory, String schemaLocation) { XSDInclude xsdInclude = factory.createXSDInclude(); xsdInclude.setSchemaLocation(schemaLocation); schema.getContents().add(xsdInclude); }
protected void addImport(String namespace, String schemaLocation) { XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport(); xsdImport.setNamespace(namespace); xsdImport.setSchemaLocation(schemaLocation); xsdSchema.getContents().add(0, xsdImport); }
protected void addImport(String namespace, String schemaLocation) { XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport(); xsdImport.setNamespace(namespace); xsdImport.setSchemaLocation(schemaLocation); xsdSchema.getContents().add(0, xsdImport); }
final XSDResourceImpl rsrc = new XSDResourceImpl(URI.createFileURI(xsdFileWithPath)); rsrc.load(new HashMap()); final XSDSchema schema = rsrc.getSchema(); for (Object content : schema.getContents()) { if (content instanceof XSDImport) { XSDImport xsdImport = (XSDImport) content; xsdImport.resolveTypeDefinition(xsdImport.getNamespace(), ""); } }
protected void importXMI() { Map<String, String> namespaces = this.xsdSchema.getQNamePrefixToNamespaceMap(); if (namespaces.put(XMI_PREFIX, XMI_URI) == null) { XSDImport xmiImport = XSDFactory.eINSTANCE.createXSDImport(); xmiImport.setNamespace(XMI_URI); xmiImport.setSchemaLocation(EcorePackage.eNS_URI.equals(xsdSchema.getTargetNamespace()) ? XMI_SCHEMA_LOCATION : "platform:/plugin/org.eclipse.emf.ecore/model/" + XMI_SCHEMA_LOCATION); this.xsdSchema.getContents().add(0, xmiImport); } } }
protected void importXMI() { Map<String, String> namespaces = this.xsdSchema.getQNamePrefixToNamespaceMap(); if (namespaces.put(XMI_PREFIX, XMI_URI) == null) { XSDImport xmiImport = XSDFactory.eINSTANCE.createXSDImport(); xmiImport.setNamespace(XMI_URI); xmiImport.setSchemaLocation(EcorePackage.eNS_URI.equals(xsdSchema.getTargetNamespace()) ? XMI_SCHEMA_LOCATION : "platform:/plugin/org.eclipse.emf.ecore/model/" + XMI_SCHEMA_LOCATION); this.xsdSchema.getContents().add(0, xmiImport); } } }
protected void importGMLSchema(XSDSchema schema, XSDFactory factory, String baseUrl) { XSDImport imprt = factory.createXSDImport(); imprt.setNamespace(gmlNamespace); imprt.setSchemaLocation(ResponseUtils.buildSchemaURL(baseUrl, gmlSchemaLocation)); XSDSchema gmlSchema = gmlSchema(); imprt.setResolvedSchema(gmlSchema); schema.getContents().add(imprt); }
protected XSDAttributeDeclaration createGlobalXSDAttributeDeclaration(XSDSchema xsdSchema) { ensureSchemaElement(xsdSchema); XSDAttributeDeclaration attribute = XSDFactory.eINSTANCE.createXSDAttributeDeclaration(); attribute.setTypeDefinition(xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("string")); //$NON-NLS-1$ attribute.setName(XSDCommonUIUtils.createUniqueElementName("NewAttribute", xsdSchema.getAttributeDeclarations())); //$NON-NLS-1$ Text textNode = xsdSchema.getDocument().createTextNode("\n"); //$NON-NLS-1$ xsdSchema.getElement().appendChild(textNode); xsdSchema.getContents().add(attribute); return attribute; }
protected XSDElementDeclaration buildGlobalElement(XSDSchema xsdSchema, EClass eClass) { XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); xsdElementDeclaration.setName(extendedMetaData.getName(eClass)); XSDTypeDefinition xsdTypeDefinition = xsdSchema.resolveTypeDefinitionURI(getURI(eClass)); handleImport(xsdSchema, xsdTypeDefinition); xsdElementDeclaration.setTypeDefinition(xsdTypeDefinition); xsdSchema.getContents().add(xsdElementDeclaration); map(xsdElementDeclaration, eClass); createEcoreAnnotation(xsdElementDeclaration, "ignore", "true"); return xsdElementDeclaration; }
protected XSDElementDeclaration buildGlobalElement(XSDSchema xsdSchema, EClass eClass) { XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); xsdElementDeclaration.setName(extendedMetaData.getName(eClass)); XSDTypeDefinition xsdTypeDefinition = xsdSchema.resolveTypeDefinitionURI(getURI(eClass)); handleImport(xsdSchema, xsdTypeDefinition); xsdElementDeclaration.setTypeDefinition(xsdTypeDefinition); xsdSchema.getContents().add(xsdElementDeclaration); map(xsdElementDeclaration, eClass); createEcoreAnnotation(xsdElementDeclaration, "ignore", "true"); return xsdElementDeclaration; }