Java 类org.eclipse.emf.ecore.xmi.XMLSave 实例源码

项目:OpenSPIFe    文件:PlanResourceImpl.java   
@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);
    }
}
项目:kie-wb-common    文件:JBPMBpmn2ResourceImpl.java   
@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);
        }
    };
}
项目:Saturn    文件:SaturnResourceImpl.java   
/**
 * @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_);
  }

}
项目:OpenSPIFe    文件:PlanResourceImpl.java   
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();
}
项目:OpenSPIFe    文件:PlanResourceImpl.java   
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);
}
项目:fixflow    文件:Bpmn2ResourceImpl.java   
@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);
        }
    };
}
项目:fixflow    文件:Bpmn2XMIResourceImpl.java   
@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);
        }
    };
}
项目:emf-fragments    文件:XMIFragmentImpl.java   
@Override
protected XMLSave createXMLSave() {
    return new XMISaveImpl(createXMLHelper()) {
        @Override
        protected void saveHref(EObject remote, EStructuralFeature f) {
            ((MyXMLHelper) helper).currentFeature = f;
            super.saveHref(remote, f);
        }
    };
}
项目:OpenSPIFe    文件:PlanResourceImpl.java   
@Override
protected XMLSave createXMLSave() {
    return createXMLSave(this.getContents(), true);
}