save(resource, writeable.asWriter(), options); return; init(resource, options); @SuppressWarnings("unchecked") List<? extends EObject> contents = roots = (List<? extends EObject>)options.get(XMLResource.OPTION_ROOT_OBJECTS); traverse(contents); writeAscii(outputStream); outputStream.flush(); write((Writer)outputStreamWriter); outputStreamWriter.flush(); endSave(contents); this.xmlResource = null;
protected XMLSave createXMLSave() { return new XMLSaveImpl(createXMLHelper()); }
mark = writeTopObject(contents.get(0)); mark = writeTopObjects(contents); addNamespaceDeclarations(); addDoctypeInformation();
public void save(XMLResource resource, Writer writer, Map<?, ?> options) throws IOException { this.xmlResource = resource; init(resource, options); @SuppressWarnings("unchecked") List<? extends EObject> contents = roots = (List<? extends EObject>)options.get(XMLResource.OPTION_ROOT_OBJECTS); if (contents == null) { contents = resource.getContents(); } traverse(contents); write(writer); writer.flush(); endSave(contents); this.xmlResource = null; }
public Document save(XMLResource resource, Document doc, Map<?, ?> options, DOMHandler handler) { toDOM = true; document = doc; this.handler = handler; this.xmlResource = resource; init(resource, options); @SuppressWarnings("unchecked") List<? extends EObject> contents = roots = (List<? extends EObject>)options.get(XMLResource.OPTION_ROOT_OBJECTS); if (contents == null) { contents = resource.getContents(); } traverse(contents); try { endSave(contents); } catch (Exception e) { e.printStackTrace(); } xmlResource = null; return document; }
writeTopAttributes(root); if (kind != TRANSIENT && shouldSaveFeature(o, f)) content = getDataTypeElementSingleSimple(o, f); continue LOOP; saveDataTypeSingle(o, f); continue LOOP; if (!isNil(o, f)) saveDataTypeSingle(o, f); continue LOOP; saveEObjectSingle(o, f); continue LOOP; saveEObjectMany(o, f); continue LOOP; saveIDRefSingle(o, f); continue LOOP; saveIDRefMany(o, f); continue LOOP; if (isNil(o, f))
@Override protected void init(XMLResource resource, Map<?, ?> options) { super.init(resource, options); featureTable = new JBPMXMLSaveImpl.JBPMLookup(map, extendedMetaData, elementHandler); }
if (href != null) href = convertURI(href); EClass eClass = remote.eClass(); EClass expectedType = (EClass) f.getEType(); saveTypeAttribute(eClass); if (proxyAttributes) saveFeatures(remote, true); processAttributeExtensions(remote); if (processElementExtensions(remote)) if (proxyAttributes) saveFeatures(remote, true); processAttributeExtensions(remote); processElementExtensions(remote);
@Override public void traverse(List<? extends EObject> contents) { for (EObject e : contents) { if (e instanceof Definitions) { List<RootElement> roots = ((Definitions) e).getRootElements(); Process p = null; for (RootElement root : roots) { if (root instanceof Process) { p = (Process) root; } } if (p != null) { ((Definitions) e).getRootElements().remove(p); ((Definitions) e).getRootElements().add(p); } } } super.traverse(contents); }
if (resource != null && resource.getContents().size() >= 1) EObject root = getSchemaLocationRoot(resource.getContents().get(0)); EClass eClass = root.eClass(); location = convertURI(location); if (location.endsWith("#/")) if (nsURI != null && !isDuplicateURI(nsURI))
protected String getElementReferenceSingleSimple(EObject o, EStructuralFeature f) { EObject value = (EObject)helper.getValue(o, f); String svalue = helper.getHREF(value); if (svalue != null) { svalue = convertURI(svalue); if (toDOM) { Node text = document.createTextNode(svalue); currentNode.appendChild(text); handler.recordValues(text, o, f, value); } } return svalue; }
if (href != null) href = convertURI(href); EClass eClass = remote.eClass(); EClass expectedType = (EClass)f.getEType(); saveTypeAttribute(eClass);
@Override public void addNamespaceDeclarations() { String version = XMIResource.VERSION_VALUE; if (xmlResource != null) { version = ((XMIResource)xmlResource).getXMIVersion(); } if (!toDOM) { doc.addAttribute(XMI_VER_NS, version); doc.addAttribute(XMI_XMLNS, xmiURI); } else { ((Element)currentNode).setAttributeNS(xmiURI, XMI_VER_NS, version); ((Element)currentNode).setAttributeNS(ExtendedMetaData.XMLNS_URI, XMI_XMLNS, xmiURI); } super.addNamespaceDeclarations(); }
writeTopAttributes(root); if (kind != TRANSIENT && shouldSaveFeature(o, f)) content = getDataTypeElementSingleSimple(o, f); continue LOOP; saveDataTypeSingle(o, f); continue LOOP; if (!isNil(o, f)) saveDataTypeSingle(o, f); continue LOOP; saveEObjectSingle(o, f); continue LOOP; saveEObjectMany(o, f); continue LOOP; saveIDRefSingle(o, f); continue LOOP; saveIDRefMany(o, f); continue LOOP; if (isNil(o, f))
public void save(XMLResource resource, Writer writer, Map<?, ?> options) throws IOException { this.xmlResource = resource; init(resource, options); @SuppressWarnings("unchecked") List<? extends EObject> contents = roots = (List<? extends EObject>)options.get(XMLResource.OPTION_ROOT_OBJECTS); if (contents == null) { contents = resource.getContents(); } traverse(contents); write(writer); writer.flush(); endSave(contents); this.xmlResource = null; }
public Document save(XMLResource resource, Document doc, Map<?, ?> options, DOMHandler handler) { toDOM = true; document = doc; this.handler = handler; this.xmlResource = resource; init(resource, options); @SuppressWarnings("unchecked") List<? extends EObject> contents = roots = (List<? extends EObject>)options.get(XMLResource.OPTION_ROOT_OBJECTS); if (contents == null) { contents = resource.getContents(); } traverse(contents); try { endSave(contents); } catch (Exception e) { e.printStackTrace(); } xmlResource = null; return document; }
public XMLSaveImpl(Map<?, ?> options, XMLHelper helper, String encoding, String xmlVersion) { this.helper = helper; init(helper.getResource(), options); this.encoding = encoding; this.xmlVersion = xmlVersion; }
if (href != null) href = convertURI(href); EClass eClass = remote.eClass(); EClass expectedType = (EClass) f.getEType(); saveTypeAttribute(eClass); if (proxyAttributes) saveFeatures(remote, true); processAttributeExtensions(remote); if (processElementExtensions(remote)) if (proxyAttributes) saveFeatures(remote, true); processAttributeExtensions(remote); processElementExtensions(remote);
@Override public void traverse(List<? extends EObject> contents) { for(EObject e : contents) { if(e instanceof Definitions) { List<RootElement> roots = ((Definitions) e).getRootElements(); Process p = null; for(RootElement root : roots) { if(root instanceof Process) { p = (Process) root; } } if(p != null) { ((Definitions) e).getRootElements().remove(p); ((Definitions) e).getRootElements().add(p); } } } super.traverse(contents); }