(LoadContext context, CDOMObject obj)
| 165 | } |
| 166 | |
| 167 | @Override |
| 168 | public String[] unparse(LoadContext context, CDOMObject obj) |
| 169 | { |
| 170 | Changes<CDOMReference<Skill>> changes = context.getObjectContext().getListChanges(obj, ListKey.CSKILL); |
| 171 | Changes<ChooseSelectionActor<?>> listChanges = |
| 172 | context.getObjectContext().getListChanges(obj, ListKey.NEW_CHOOSE_ACTOR); |
| 173 | List<String> list = new ArrayList<>(); |
| 174 | Collection<CDOMReference<Skill>> removedItems = changes.getRemoved(); |
| 175 | if (removedItems != null && !removedItems.isEmpty()) |
| 176 | { |
| 177 | if (changes.includesGlobalClear()) |
| 178 | { |
| 179 | context.addWriteMessage( |
| 180 | "Non-sensical relationship in " + getTokenName() + ": global .CLEAR and local .CLEAR. performed"); |
| 181 | return null; |
| 182 | } |
| 183 | list.add(Constants.LST_DOT_CLEAR_DOT + ReferenceUtilities.joinLstFormat(removedItems, "|.CLEAR.")); |
| 184 | } |
| 185 | Collection<ChooseSelectionActor<?>> listRemoved = listChanges.getRemoved(); |
| 186 | if (listRemoved != null && !listRemoved.isEmpty()) |
| 187 | { |
| 188 | if (listRemoved.contains(this)) |
| 189 | { |
| 190 | list.add(".CLEAR.LIST"); |
| 191 | } |
| 192 | } |
| 193 | if (changes.includesGlobalClear()) |
| 194 | { |
| 195 | list.add(Constants.LST_DOT_CLEAR); |
| 196 | } |
| 197 | Collection<CDOMReference<Skill>> added = changes.getAdded(); |
| 198 | if (added != null && !added.isEmpty()) |
| 199 | { |
| 200 | list.add(ReferenceUtilities.joinLstFormat(added, Constants.PIPE)); |
| 201 | } |
| 202 | Collection<ChooseSelectionActor<?>> listAdded = listChanges.getAdded(); |
| 203 | if (listAdded != null && !listAdded.isEmpty()) |
| 204 | { |
| 205 | for (ChooseSelectionActor<?> cra : listAdded) |
| 206 | { |
| 207 | if (cra.getSource().equals(SOURCE)) |
| 208 | { |
| 209 | try |
| 210 | { |
| 211 | list.add(cra.getLstFormat()); |
| 212 | } |
| 213 | catch (PersistenceLayerException e) |
| 214 | { |
| 215 | context.addWriteMessage("Error writing Prerequisite: " + e); |
| 216 | return null; |
| 217 | } |
| 218 | } |
| 219 | } |
| 220 | } |
| 221 | if (list.isEmpty()) |
| 222 | { |
| 223 | return null; |
| 224 | } |
nothing calls this directly
no test coverage detected