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

Method parsePCClassText

code/src/test/pcgen/core/PCClassTest.java:998–1015  ·  view source on GitHub ↗

Parse a class definition and return the populated PCClass object. @param classPCCText The textual definition of the class. @param source The source that the class is from. @return The populated class. @throws PersistenceLayerException

(String classPCCText,
	                                        CampaignSourceEntry source)

Source from the content-addressed store, hash-verified

996 * @throws PersistenceLayerException
997 */
998 private static PCClass parsePCClassText(String classPCCText,
999 CampaignSourceEntry source) throws PersistenceLayerException
1000 {
1001 PCClassLoader pcClassLoader = new PCClassLoader();
1002 PCClass reconstClass = null;
1003 StringTokenizer tok = new StringTokenizer(classPCCText, "\n");
1004 while (tok.hasMoreTokens())
1005 {
1006 String line = tok.nextToken();
1007 if (!line.trim().isEmpty())
1008 {
1009 System.out.println("Processing line: '" + line + "'.");
1010 reconstClass =
1011 pcClassLoader.parseLine(Globals.getContext(), reconstClass, line, source);
1012 }
1013 }
1014 return reconstClass;
1015 }
1016
1017 @BeforeEach
1018 @Override

Callers 2

testGetPCCTextMethod · 0.95
testAddAbilityMethod · 0.95

Calls 6

parseLineMethod · 0.95
getContextMethod · 0.95
hasMoreTokensMethod · 0.80
nextTokenMethod · 0.80
trimMethod · 0.80
isEmptyMethod · 0.65

Tested by

no test coverage detected