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

Method unparse

code/src/java/plugin/lsttokens/AddLst.java:123–141  ·  view source on GitHub ↗
(LoadContext context, CDOMObject obj)

Source from the content-addressed store, hash-verified

121 }
122
123 @Override
124 public String[] unparse(LoadContext context, CDOMObject obj)
125 {
126 String[] unparsed = context.unparseSubtoken(obj, getTokenName());
127 Changes<PersistentTransitionChoice<?>> changes = context.getObjectContext().getListChanges(obj, ListKey.ADD);
128 if (changes.includesGlobalClear())
129 {
130 StringBuilder clearSB = new StringBuilder();
131 clearSB.append(Constants.LST_DOT_CLEAR);
132 if (obj instanceof PCClassLevel)
133 {
134 clearSB.append(".LEVEL");
135 Integer lvl = obj.get(IntegerKey.LEVEL);
136 clearSB.append(lvl);
137 }
138 unparsed = ArrayUtilities.prependOnCopy(clearSB.toString(), unparsed, String.class);
139 }
140 return unparsed;
141 }
142
143 @Override
144 public Class<CDOMObject> getTokenClass()

Callers

nothing calls this directly

Calls 9

getTokenNameMethod · 0.95
prependOnCopyMethod · 0.95
unparseSubtokenMethod · 0.65
getListChangesMethod · 0.65
getObjectContextMethod · 0.65
includesGlobalClearMethod · 0.65
getMethod · 0.65
toStringMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected