public void load(Element e) { Element mementoElem = e.getChild(MEMENTO); if (mementoElem != null) { myMemento = MementoPersistence.loadMemento(mementoElem); } Element inspectorMementoElem = e.getChild(INSPECTOR_MEMENTO); if (inspectorMementoElem != null) { myInspectorMemento = MementoPersistence.loadMemento(inspectorMementoElem); } }
public void save(Element e) { if (myMemento != null) { Element mementoElem = new Element(MEMENTO); MementoPersistence.saveMemento(myMemento, mementoElem); e.addContent(mementoElem); } if (myInspectorMemento != null) { Element mementoElem = new Element(INSPECTOR_MEMENTO); MementoPersistence.saveMemento(myInspectorMemento, mementoElem); e.addContent(mementoElem); } }