XSDImport imprt = XSDFactory.eINSTANCE.createXSDImport(); imprt.setNamespace(importee.getTargetNamespace()); schema.getContents().add(imprt);
XSDImport gml = factory.createXSDImport(); gml.setNamespace(gmlNamespace); gml.setSchemaLocation(baseURL.toString() + "/" + gmlLocation);
public static XSDImport createImport(Node node) { if (XSDConstants.nodeType(node) == XSDConstants.IMPORT_ELEMENT) { XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport(); xsdImport.setElement((Element)node); return xsdImport; } return null; }
public static XSDImport createImport(Node node) { if (XSDConstants.nodeType(node) == XSDConstants.IMPORT_ELEMENT) { XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport(); xsdImport.setElement((Element)node); return xsdImport; } return null; }
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); }
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); } } }
/** * Add import statement to schema. * * @param schema Output schema * @param factory XSD factory used to produce schema * @param namespace Import name space * @param schemaLocation The schema to be imported */ private void addImport( XSDSchema schema, XSDFactory factory, String namespace, String schemaLocation) { synchronized (Schemas.class) { XSDImport xsdImport = factory.createXSDImport(); xsdImport.setNamespace(namespace); xsdImport.setSchemaLocation(schemaLocation); schema.getContents().add(xsdImport); } }
XSDImport someOtherImport = xsdFactory./*{@link XSDFactory#createXSDImport */createXSDImport/*}*/(); someOtherImport./*{@link XSDImport#setNamespace */setNamespace/*}*/(/*{@link #*/someOtherSchemaURI/*}*/); someOtherImport./*{@link XSDImport#setSchemaLocation */setSchemaLocation/*}*/(someOtherSchemaURI);
XSDImport someOtherImport = xsdFactory./*{@link XSDFactory#createXSDImport */createXSDImport/*}*/(); someOtherImport./*{@link XSDImport#setNamespace */setNamespace/*}*/(/*{@link #*/someOtherSchemaURI/*}*/); someOtherImport./*{@link XSDImport#setSchemaLocation */setSchemaLocation/*}*/(someOtherSchemaURI);
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); }
/** Imports the WFS 1.0.0 schema as a dependency. */ private static XSDSchema importWfsSchema(XSDSchema schema) throws IOException { XSDSchema wfsSchema = org.geotools.wfs.v1_1.WFS.getInstance().getSchema(); if (wfsSchema == null || !(wfsSchema instanceof XSDSchemaImpl)) { return schema; } XSDImport wfsImport = XSDFactory.eINSTANCE.createXSDImport(); wfsImport.setNamespace(org.geotools.wfs.v1_1.WFS.NAMESPACE); wfsImport.setResolvedSchema(wfsSchema); schema.getContents().add(wfsImport); schema.getQNamePrefixToNamespaceMap().put("wfs", org.geotools.wfs.v1_1.WFS.NAMESPACE); synchronized (wfsSchema.eAdapters()) { ((XSDSchemaImpl) wfsSchema).imported(wfsImport); } // make sure that GML 3.1 namespace is used schema.getQNamePrefixToNamespaceMap().put("gml", GML.NAMESPACE); return schema; } }
void buildSchemaImports( Collection<NamespaceInfo> namespaces, XSDSchema schema, XSDFactory factory) { Map<String, String> params = params( "service", "wfs", "request", "DescribeFeatureType", "version", wfs.getVersion()); // String schemaLocation = ResponseUtils.appendQueryString(ResponseUtils.appendPath( // baseURL, "wfs"), // "service=wfs&request=DescribeFeatureType&version=" + wfs.getVersion() + // "&namespace="); for (NamespaceInfo namespace : namespaces) { XSDImport imprt = factory.createXSDImport(); imprt.setNamespace(namespace.getURI()); params.put("namespace", namespace.getPrefix()); imprt.setSchemaLocation(buildURL(baseURL, "wfs", params, URLType.SERVICE)); synchronized (Schemas.class) { schema.getContents().add(imprt); } } }
public void execute() { try { super.execute(); // Add this after if we don't have a DOM Node yet beginRecording(xsdSchema.getElement()); XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport(); xsdSchema.getContents().add(findNextPositionToInsert(), xsdImport); addedXSDConcreteComponent = xsdImport; formatChild(xsdSchema.getElement()); } finally { endRecording(); } } }
@Override protected void importGMLSchema(XSDSchema schema, XSDFactory factory, String baseUrl) { synchronized (Schemas.class) { XSDImport imprt; try { imprt = factory.createXSDImport(); imprt.setNamespace(gmlNamespace); // imprt.setNamespace( WFS.getInstance().getSchema().getTargetNamespace() ); imprt.setSchemaLocation( ResponseUtils.buildSchemaURL(baseUrl, gmlSchemaLocation)); // imprt.setResolvedSchema(WFS.getInstance().getSchema()); imprt.setResolvedSchema(GML.getInstance().getSchema()); schema.getContents().add(imprt); schema.getQNamePrefixToNamespaceMap().put("wfs", WFS.NAMESPACE); // imprt = Schemas.importSchema(schema, WFS.getInstance().getSchema()); final XSDSchemaImpl xsdSchema = (XSDSchemaImpl) WFS.getInstance().getSchema(); synchronized (xsdSchema.eAdapters()) { xsdSchema.imported(imprt); } // ((XSDSchemaImpl)schema).resolveSchema(WFS.NAMESPACE); // schema.getContents().add(imprt); } catch (IOException e) { throw new RuntimeException(e); } } }
XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport(); xsdImport.setNamespace(namespace);
XSDImport xsdImport = XSDFactory.eINSTANCE.createXSDImport(); xsdImport.setNamespace(namespace);
@Override public XSDConcreteComponent cloneConcreteComponent(boolean deep, boolean shareDOM) { XSDImportImpl clonedImport = (XSDImportImpl)getXSDFactory().createXSDImport(); clonedImport.isReconciling = true; clonedImport.setNamespace(getNamespace()); clonedImport.setSchemaLocation(getSchemaLocation()); if (deep) { if (getAnnotation() != null) { clonedImport.setAnnotation((XSDAnnotation)getAnnotation().cloneConcreteComponent(deep, shareDOM)); } } if (shareDOM && getElement() != null) { clonedImport.setElement(getElement()); } clonedImport.isReconciling = shareDOM; return clonedImport; } }
@Override public XSDConcreteComponent cloneConcreteComponent(boolean deep, boolean shareDOM) { XSDImportImpl clonedImport = (XSDImportImpl)getXSDFactory().createXSDImport(); clonedImport.isReconciling = true; clonedImport.setNamespace(getNamespace()); clonedImport.setSchemaLocation(getSchemaLocation()); if (deep) { if (getAnnotation() != null) { clonedImport.setAnnotation((XSDAnnotation)getAnnotation().cloneConcreteComponent(deep, shareDOM)); } } if (shareDOM && getElement() != null) { clonedImport.setElement(getElement()); } clonedImport.isReconciling = shareDOM; return clonedImport; } }