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

Method parseLine

code/src/java/pcgen/persistence/lst/InstallLoader.java:49–75  ·  view source on GitHub ↗
(LoadContext context, String inputLine, URI sourceURI)

Source from the content-addressed store, hash-verified

47 }
48
49 @Override
50 public void parseLine(LoadContext context, String inputLine, URI sourceURI)
51 {
52 final int idxColon = inputLine.indexOf(':');
53 if (idxColon < 0)
54 {
55 Logging.errorPrint("Unparsed line: " + inputLine + " in " + sourceURI.toString());
56 return;
57 }
58 final String key = inputLine.substring(0, idxColon);
59 final String value = inputLine.substring(idxColon + 1);
60 Map<String, LstToken> tokenMap = TokenStore.inst().getTokenMap(InstallLstToken.class);
61 InstallLstToken token = (InstallLstToken) tokenMap.get(key);
62
63 if (token != null)
64 {
65 LstUtils.deprecationCheck(token, campaign, value);
66 if (!token.parse(campaign, new String(value), sourceURI))
67 {
68 Logging.errorPrint("Error parsing install " + campaign.getDisplayName() + ':' + inputLine);
69 }
70 }
71 else
72 {
73 Logging.errorPrint("Unparsed line: " + inputLine + " in " + sourceURI.toString());
74 }
75 }
76
77 public InstallableCampaign getCampaign()
78 {

Callers

nothing calls this directly

Calls 9

errorPrintMethod · 0.95
instMethod · 0.95
deprecationCheckMethod · 0.95
parseMethod · 0.95
getTokenMapMethod · 0.80
indexOfMethod · 0.65
toStringMethod · 0.65
getMethod · 0.65
getDisplayNameMethod · 0.65

Tested by

no test coverage detected