capint
5/29/2016 - 9:46 AM

EMF >> Resource >> XMLSave

EMF >> Resource >> XMLSave

>> Add a comment to the saved resource
public class XMIExtensionSaveImpl extends XMLSaveImpl {
  @Override
  protected Object writeTopObject(EObject top) {
    //*** Mark the beginning of document
    _capellaReleaseMark = doc.mark();
    return super.writeTopObject(top);
  }
  
  @Override
  protected void addDoctypeInformation() {
    // Add Capella Version as comment.
    doc.resetToMark(_capellaReleaseMark);
    doc.addComment(CAPELLA_VERSION_PREFIX + FeatureHelper.getCapellaVersion(false));
    doc.addLine();
    super.addDoctypeInformation();
  }
}
Used by the XMLResource to customize the way to save resource.