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

Method process

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

Source from the content-addressed store, hash-verified

175 * target of 5.17, this probably isn't a big deal.
176 */
177 @Override
178 public boolean process(LoadContext context, CDOMObject obj)
179 {
180 ChooseInformation<?> newChoose = obj.get(ObjectKey.CHOOSE_INFO);
181 String oldChoose = obj.get(StringKey.CHOICE_STRING);
182 if (newChoose != null && oldChoose != null)
183 {
184 Logging.errorPrint("New style CHOOSE " + "and old style CHOOSE both found on "
185 + obj.getClass().getSimpleName() + ' ' + obj.getKeyName());
186 return false;
187 }
188 if (newChoose != null)
189 {
190 Class<?> chooseClass = newChoose.getReferenceClass();
191 List<ChooseSelectionActor<?>> newactors = obj.getListFor(ListKey.NEW_CHOOSE_ACTOR);
192 if (newactors != null)
193 {
194 for (ChooseSelectionActor<?> csa : newactors)
195 {
196 if (!chooseClass.equals(csa.getChoiceClass()))
197 {
198 Logging.errorPrint("CHOOSE of type " + chooseClass.getName() + " on "
199 + obj.getClass().getSimpleName() + ' ' + obj.getKeyName() + " had an actor from token "
200 + csa.getSource() + " that was expecting a " + csa.getChoiceClass().getSimpleName());
201 return false;
202 }
203 }
204 }
205 }
206 return true;
207 }
208
209 @Override
210 public int getPriority()

Callers

nothing calls this directly

Calls 10

errorPrintMethod · 0.95
getSimpleNameMethod · 0.80
getMethod · 0.65
getKeyNameMethod · 0.65
getReferenceClassMethod · 0.65
getListForMethod · 0.65
equalsMethod · 0.65
getChoiceClassMethod · 0.65
getNameMethod · 0.65
getSourceMethod · 0.65

Tested by

no test coverage detected