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

Method parseNonEmptyToken

code/src/java/plugin/lsttokens/AutoLst.java:37–51  ·  view source on GitHub ↗
(LoadContext context, CDOMObject obj, String value)

Source from the content-addressed store, hash-verified

35 }
36
37 @Override
38 protected ParseResult parseNonEmptyToken(LoadContext context, CDOMObject obj, String value)
39 {
40 if (obj instanceof Ungranted)
41 {
42 return new ParseResult.Fail(
43 "Cannot use " + getTokenName() + " on an Ungranted object type: " + obj.getClass().getSimpleName());
44 }
45 int pipeLoc = value.indexOf(Constants.PIPE);
46 if (pipeLoc == -1)
47 {
48 return new ParseResult.Fail(getTokenName() + " requires a SubToken");
49 }
50 return context.processSubToken(obj, getTokenName(), value.substring(0, pipeLoc), value.substring(pipeLoc + 1));
51 }
52
53 @Override
54 public String[] unparse(LoadContext context, CDOMObject obj)

Callers

nothing calls this directly

Calls 4

getTokenNameMethod · 0.95
getSimpleNameMethod · 0.80
indexOfMethod · 0.65
processSubTokenMethod · 0.65

Tested by

no test coverage detected