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

Method getToken

code/src/java/plugin/exporttokens/WeaponpToken.java:56–77  ·  view source on GitHub ↗

Get the value of the token. @param tokenSource The full source of the token @param pc The character to retrieve the value for. @param eh The ExportHandler that is managing the export. @return The value of the token.

(String tokenSource, PlayerCharacter pc, ExportHandler eh)

Source from the content-addressed store, hash-verified

54 * @return The value of the token.
55 */
56 @Override
57 public String getToken(String tokenSource, PlayerCharacter pc, ExportHandler eh)
58 {
59 StringTokenizer aTok = new StringTokenizer(tokenSource, ".", false);
60 //Weaponp Token
61 aTok.nextToken();
62
63 if (pc.getDisplay().hasPrimaryWeapons())
64 {
65 Equipment eq = pc.getDisplay().getPrimaryWeapons().iterator().next();
66 return getWeaponToken(pc, eq, aTok, tokenSource);
67 }
68 else if (eh != null && eh.getExistsOnly())
69 {
70 eh.setNoMoreItems(true);
71 if (eh.getCheckBefore())
72 {
73 eh.setCanWrite(false);
74 }
75 }
76 return "";
77 }
78}

Callers

nothing calls this directly

Calls 11

nextTokenMethod · 0.80
hasPrimaryWeaponsMethod · 0.80
getPrimaryWeaponsMethod · 0.80
getWeaponTokenMethod · 0.80
getExistsOnlyMethod · 0.80
setNoMoreItemsMethod · 0.80
getCheckBeforeMethod · 0.80
setCanWriteMethod · 0.80
getDisplayMethod · 0.45
nextMethod · 0.45
iteratorMethod · 0.45

Tested by

no test coverage detected