39 | | ^(Describe your design here.)^ |
| 39 | //--------BASE_PERSISTER_PART-------------------- |
| 40 | |
| 41 | In order to achieve this functionallity the following changes have been made: |
| 42 | * In TextRun class add new function : public HotStyleDef getRunStyles() - retrieves the |
| 43 | styles that the run contains and returns the styles of the TextRun. This is needed in the persister class |
| 44 | of the TextRun (TextRunPersister). |
| 45 | * In HotStyleDef class add new function : public ImmMap<HotAttr<?>, Object> getValues() - |
| 46 | getter for all attributes that the current HotStyleDef consists of, returns the current HotStyleDef |
| 47 | values for the contained attributes. This is needed while persisting the HotStyleDef objects(in |
| 48 | HotStyleDefPersister class). |
| 49 | * In ImmMap interface add new function: Map<K, V> toMap() - gets the Map for the current ImmMap |
| 50 | and returns a Map view of the ImmMap. This is needed because HotStyleDef#derive |
| 51 | (Map<HotAttr<?>, Object> styleValues) takes Map and while persisting the HotStyleDef |
| 52 | we have only ImmMap available. |
| 53 | * Implement the toMap() function in ImmTreeMap class. |
| 54 | * In org.sophie2.base.model.text.persistence add new classes: |
| 55 | * public class HotStyleDefPersister extends RefToStoragePersister<HotStyleDef> - persister for |
| 56 | HotStyleDef class. It persists the Map of the HotAttr<?> -> Object of the HotStyleDef objects. |
| 57 | * public class TextRunPersister extends RefToStoragePersister<TextRun> - persister for TextRun class. |
| 58 | It persists the text of the TextRun as string and it's HotStyleDef. |
| 59 | * public class ImmHotTextPersister extends RefToStoragePersister<ImmHotText> - persister for ImmHotText class. |
| 60 | It persists the ImmHotText as follows: gets the TextRun-s of the text and persists them. |
| 61 | * Rename the HotTextIntervalPersister to ImmTextIntervalPersister. |
| 62 | |
| 63 | //--------CONVERT_PERSISTER_PART-------------- |