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

Method parseToken

code/src/java/plugin/lsttokens/SelectLst.java:41–56  ·  view source on GitHub ↗
(LoadContext context, CDOMObject cdo, String value)

Source from the content-addressed store, hash-verified

39 }
40
41 @Override
42 public ParseResult parseToken(LoadContext context, CDOMObject cdo, String value)
43 {
44 if (cdo instanceof Ungranted)
45 {
46 return new ParseResult.Fail(
47 "Cannot use " + getTokenName() + " on an Ungranted object type: " + cdo.getClass().getSimpleName());
48 }
49 Formula formula = FormulaFactory.getFormulaFor(value);
50 if (!formula.isValid())
51 {
52 return new ParseResult.Fail("Formula in " + getTokenName() + " was not valid: " + formula.toString());
53 }
54 context.getObjectContext().put(cdo, FormulaKey.SELECT, formula);
55 return ParseResult.SUCCESS;
56 }
57
58 @Override
59 public String[] unparse(LoadContext context, CDOMObject cdo)

Callers

nothing calls this directly

Calls 7

getTokenNameMethod · 0.95
getFormulaForMethod · 0.95
isValidMethod · 0.95
getSimpleNameMethod · 0.80
toStringMethod · 0.65
putMethod · 0.65
getObjectContextMethod · 0.65

Tested by

no test coverage detected