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

Method getDomainSource

code/src/java/pcgen/io/PCGVer2Parser.java:5828–5858  ·  view source on GitHub ↗

Set the source of the domain. See getDomainSource() for details. This method should NOT be called outside of file i/o routines! @param aSource the source to be set

(String aSource)

Source from the content-addressed store, hash-verified

5826 * @param aSource the source to be set
5827 **/
5828 public ClassSource getDomainSource(String aSource)
5829 {
5830 final StringTokenizer aTok = new StringTokenizer(aSource, "|", false);
5831
5832 if (aTok.countTokens() < 2)
5833 {
5834 Logging.errorPrint("Invalid Domain Source:" + aSource);
5835 return null;
5836 }
5837
5838 aTok.nextToken(); //Throw away "PCClass"
5839
5840 String classString = aTok.nextToken();
5841 PCClass cl = thePC.getClassKeyed(classString);
5842 if (cl == null)
5843 {
5844 Logging.errorPrint("Invalid Class in Domain Source:" + aSource);
5845 return null;
5846 }
5847 ClassSource cs;
5848 if (aTok.hasMoreTokens())
5849 {
5850 int level = Integer.parseInt(aTok.nextToken());
5851 cs = new ClassSource(cl, level);
5852 }
5853 else
5854 {
5855 cs = new ClassSource(cl);
5856 }
5857 return cs;
5858 }
5859
5860 private void insertDefaultClassSpellLists()
5861 {

Callers 7

parseDomainLineMethod · 0.95
applyChoiceMethod · 0.45
removeChoiceMethod · 0.45
applyChoiceMethod · 0.45
removeChoiceMethod · 0.45
parseSpellLineMethod · 0.45

Calls 5

errorPrintMethod · 0.95
nextTokenMethod · 0.80
hasMoreTokensMethod · 0.80
parseIntMethod · 0.80
getClassKeyedMethod · 0.45

Tested by

no test coverage detected