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

Method parseLine

code/src/java/pcgen/persistence/lst/FeatLoader.java:37–61  ·  view source on GitHub ↗
(LoadContext context, Ability aFeat, String lstLine, SourceEntry source)

Source from the content-addressed store, hash-verified

35 private boolean defaultFeatsLoaded = false;
36
37 @Override
38 public Ability parseLine(LoadContext context, Ability aFeat, String lstLine, SourceEntry source)
39 throws PersistenceLayerException
40 {
41 Ability feat = aFeat;
42
43 AbstractReferenceContext referenceContext = context.getReferenceContext();
44 AbilityCategory featCategory = referenceContext.get(AbilityCategory.class, "FEAT");
45 if (feat == null)
46 {
47 feat = new Ability();
48 int tabLoc = lstLine.indexOf(SystemLoader.TAB_DELIM);
49 String name = tabLoc == -1 ? lstLine : lstLine.substring(0, tabLoc);
50 feat.setName(name.intern());
51 feat.setCDOMCategory(featCategory);
52 context.addStatefulInformation(feat);
53 context.getReferenceContext().importObject(feat);
54 }
55 else
56 {
57 feat.setCDOMCategory(AbilityCategory.FEAT);
58 }
59
60 return super.parseLine(context, feat, lstLine, source);
61 }
62
63 @Override
64 protected void loadLstFile(LoadContext context, CampaignSourceEntry sourceEntry)

Callers 11

additionalSetUpMethod · 0.95
additionalSetUpMethod · 0.95
testAlertnessMethod · 0.95
testAmbidexterityMethod · 0.95
testSimpleWeaponMethod · 0.95
loadDefaultFeatsMethod · 0.95

Calls 8

getMethod · 0.95
setCDOMCategoryMethod · 0.95
importObjectMethod · 0.80
getReferenceContextMethod · 0.65
indexOfMethod · 0.65
setNameMethod · 0.65
parseLineMethod · 0.65

Tested by 10

additionalSetUpMethod · 0.76
additionalSetUpMethod · 0.76
testAlertnessMethod · 0.76
testAmbidexterityMethod · 0.76
testSimpleWeaponMethod · 0.76