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

Method unparse

code/src/java/plugin/lsttokens/ChooseLst.java:133–159  ·  view source on GitHub ↗
(LoadContext context, CDOMObject obj)

Source from the content-addressed store, hash-verified

131 }
132
133 @Override
134 public String[] unparse(LoadContext context, CDOMObject obj)
135 {
136 String[] str = context.unparseSubtoken(obj, getTokenName());
137 if (str == null)
138 {
139 return null;
140 }
141 Formula choices = context.getObjectContext().getFormula(obj, FormulaKey.NUMCHOICES);
142 String choicesString = choices == null ? null : "NUMCHOICES=" + choices.toString() + Constants.PIPE;
143 for (int i = 0; i < str.length; i++)
144 {
145 if (str[i].endsWith(Constants.PIPE))
146 {
147 str[i] = str[i].substring(0, str[i].length() - 1);
148 }
149 if (choicesString != null)
150 {
151 str[i] = choicesString + str[i];
152 }
153 if (str[i].startsWith("FEATEQ|"))
154 {
155 str[i] = "FEAT=" + str[i].substring(7);
156 }
157 }
158 return str;
159 }
160
161 @Override
162 public Class<CDOMObject> getTokenClass()

Callers

nothing calls this directly

Calls 5

getTokenNameMethod · 0.95
unparseSubtokenMethod · 0.65
getFormulaMethod · 0.65
getObjectContextMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected