MCPcopy Create free account
hub / github.com/PCGen/pcgen / unparse

Method unparse

code/src/java/plugin/lsttokens/SpellsLst.java:286–306  ·  view source on GitHub ↗
(LoadContext context, CDOMObject obj)

Source from the content-addressed store, hash-verified

284 }
285
286 @Override
287 public String[] unparse(LoadContext context, CDOMObject obj)
288 {
289 AssociatedChanges<CDOMReference<Spell>> changes =
290 context.getListContext().getChangesInList(getTokenName(), obj, Spell.SPELLS);
291 List<String> list = new ArrayList<>();
292 if (changes.includesGlobalClear())
293 {
294 list.add(Constants.LST_DOT_CLEAR_ALL);
295 }
296 MapToList<CDOMReference<Spell>, AssociatedPrereqObject> mtl = changes.getAddedAssociations();
297 if (mtl != null && !mtl.isEmpty())
298 {
299 list.addAll(processAdds(context, mtl));
300 }
301 if (list.isEmpty())
302 {
303 return null;
304 }
305 return list.toArray(new String[0]);
306 }
307
308 private Collection<? extends String> processAdds(LoadContext context,
309 MapToList<CDOMReference<Spell>, AssociatedPrereqObject> mtl)

Callers

nothing calls this directly

Calls 10

getTokenNameMethod · 0.95
processAddsMethod · 0.95
getChangesInListMethod · 0.65
getListContextMethod · 0.65
includesGlobalClearMethod · 0.65
addMethod · 0.65
getAddedAssociationsMethod · 0.65
isEmptyMethod · 0.65
addAllMethod · 0.65
toArrayMethod · 0.45

Tested by

no test coverage detected