zoukankan      html  css  js  c++  java
  • EMF的一些总结(3)——关于Resource的实现

    Resource通过两种方式实现XML和XMI。
    1.XML
    实现Resource存储的重要方法是save, 只有在方法eIsSet()返回true时,相关的属性和引用才会被序列化到xml中。对于存储的xml文件的格式可以通过设置OPTION_XML_MAP属性来完成,如下面原文:

    There are several reasons why you might want to use OPTION_XML_MAP when saving a resource:

    1. You want to save your data so that it conforms to a particular XML Schema.

    2. You have changed your model, and you want the resource to produce XML documents that will work with the old version of the model.

    3. You want to design your own XML format without changing your model.


    2.XMI
    XMI和XML基本相同,XMIResourceImpl就是XMLResourceImpl的简单继承,只是在引用objects时使用XMI IDs
  • 相关阅读:
    Java第一次作业
    第十一次作业
    第十次作业
    第九次作业
    第八次作业
    第七次作业
    第六次作业
    第五次作业
    java第三次实验
    java 第二次实验
  • 原文地址:https://www.cnblogs.com/youngerbaby/p/393287.html
Copyright © 2011-2022 走看看