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

Method getToken

code/src/java/plugin/exporttokens/WeightToken.java:55–74  ·  view source on GitHub ↗

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

(String tokenSource, CharacterDisplay display, ExportHandler eh)

Source from the content-addressed store, hash-verified

53 * @return The value of the token.
54 */
55 @Override
56 public String getToken(String tokenSource, CharacterDisplay display, ExportHandler eh)
57 {
58 String retString;
59 if ("WEIGHT".equals(tokenSource))
60 {
61 retString = getWeightToken(display);
62 }
63 else if ("WEIGHT.NOUNIT".equals(tokenSource))
64 {
65 retString = getNoUnitWeight(display);
66 }
67 else
68 {
69 String type = tokenSource.substring(tokenSource.lastIndexOf('.') + 1);
70 retString = Globals.getGameModeUnitSet().displayWeightInUnitSet(display.getLoadToken(type));
71 }
72
73 return retString;
74 }
75
76 private String getNoUnitWeight(CharacterDisplay display)
77 {

Callers

nothing calls this directly

Calls 7

getWeightTokenMethod · 0.95
getNoUnitWeightMethod · 0.95
getGameModeUnitSetMethod · 0.95
equalsMethod · 0.65
lastIndexOfMethod · 0.65
getLoadTokenMethod · 0.45

Tested by

no test coverage detected