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

Class SourceLoader

code/src/java/pcgen/persistence/lst/SourceLoader.java:33–65  ·  view source on GitHub ↗

Loads SOURCE

Source from the content-addressed store, hash-verified

31 * Loads SOURCE
32 */
33public final class SourceLoader
34{
35
36 private SourceLoader()
37 {
38 }
39
40 public static void parseLine(LoadContext context, String lstLine, URI sourceFile)
41 {
42 final StringTokenizer colToken = new StringTokenizer(lstLine, SystemLoader.TAB_DELIM);
43 while (colToken.hasMoreTokens())
44 {
45 String colString = colToken.nextToken().trim();
46 try
47 {
48 if (context.addStatefulToken(colString))
49 {
50 context.commit();
51 }
52 else
53 {
54 context.rollback();
55 Logging.replayParsedMessages();
56 }
57 Logging.clearParseMessages();
58 }
59 catch (PersistenceLayerException e)
60 {
61 Logging.errorPrint("Error parsing source: " + colString + " in: " + sourceFile);
62 }
63 }
64 }
65}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected