@Override public void doSave(OutputStream outputStream, Map<?, ?> options) throws IOException { XMLSave xmlSave = createXMLSave(options); if (options == null) { options = Collections.EMPTY_MAP; } ResourceHandler handler = (ResourceHandler) options.get(OPTION_RESOURCE_HANDLER); if (handler != null) { handler.preSave(this, outputStream, options); } xmlSave.save(this, outputStream, options); if (!CommonPlugin.isJunitRunning()) { System.gc(); // SPF-6899: frees about 70MB on template plan } if (handler != null) { handler.postSave(this, outputStream, options); } }
@Override protected XMLSave createXMLSave() { prepareSave(); return new JBPMXMLSaveImpl(createXMLHelper()) { @Override protected boolean shouldSaveFeature(EObject o, EStructuralFeature f) { if (Bpmn2Package.eINSTANCE.getDocumentation_Text().equals(f)) { return false; } if (Bpmn2Package.eINSTANCE.getFormalExpression_Body().equals(f)) { return false; } return super.shouldSaveFeature(o, f); } }; }
/** * @generated NOT */ @Override public void doSave(OutputStream outputStream_, Map<?, ?> options_) throws IOException { final Map<Entry, Entry> textNodes_ = new HashMap<Entry, Entry>(); Collection<EObject> objects = EcoreUtil.copyAll(this.getContents()); SaturnResourceImpl s = new SaturnResourceImpl(this.uri); s.init(); s.getContents().addAll(objects); SaturnDocLoadSaveUtil.save(s, textNodes_); XMLSave xmlSave = createXMLSave(); if (options_ == null) { options_ = Collections.EMPTY_MAP; } ResourceHandler handler = (ResourceHandler) options_.get(OPTION_RESOURCE_HANDLER); if (handler != null) { handler.preSave(s, outputStream_, options_); } xmlSave.save(s, outputStream_, options_); if (handler != null) { handler.postSave(s, outputStream_, options_); } }
protected XMLSave createXMLSave(Map options) { if (options != null) { Object object = options.get(XMLResource.OPTION_ROOT_OBJECTS); if (object instanceof List) { @SuppressWarnings("unchecked") List<EObject> list = (List<EObject>) object; return createXMLSave(list, false); } } return createXMLSave(); }
private XMLSave createXMLSave(List<EObject> roots, boolean saveDefaults) { if (CommonPlugin.isJunitRunning()) { getEObjectToIDMap().clear(); getIDToEObjectMap().clear(); } else { System.gc(); // SPF-6899: frees about 14 MB for a template plan } return new PlanResourceSaveImpl(createXMLHelper(), saveDefaults); }
@Override protected XMLSave createXMLSave() { prepareSave(); return new XMLSaveImpl(createXMLHelper()) { @Override protected boolean shouldSaveFeature(EObject o, EStructuralFeature f) { if (Bpmn2Package.eINSTANCE.getDocumentation_Text().equals(f)) return false; if (Bpmn2Package.eINSTANCE.getFormalExpression_Body().equals(f)) return false; return super.shouldSaveFeature(o, f); } }; }
@Override protected XMLSave createXMLSave() { return new XMISaveImpl(createXMLHelper()) { @Override protected boolean shouldSaveFeature(EObject o, EStructuralFeature f) { if (Bpmn2Package.eINSTANCE.getDocumentation_Mixed().equals(f)) return false; if (Bpmn2Package.eINSTANCE.getFormalExpression_Mixed().equals(f)) return false; return super.shouldSaveFeature(o, f); } }; }
@Override protected XMLSave createXMLSave() { return new XMISaveImpl(createXMLHelper()) { @Override protected void saveHref(EObject remote, EStructuralFeature f) { ((MyXMLHelper) helper).currentFeature = f; super.saveHref(remote, f); } }; }
@Override protected XMLSave createXMLSave() { return createXMLSave(this.getContents(), true); }