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

Method addToTokenMap

code/src/java/pcgen/persistence/lst/TokenStore.java:105–122  ·  view source on GitHub ↗

Add the new token to the token map @param newToken

(LstToken newToken)

Source from the content-addressed store, hash-verified

103 * @param newToken
104 */
105 public void addToTokenMap(LstToken newToken)
106 {
107 for (Class<? extends LstToken> tokClass : tokenTypeList)
108 {
109 if (tokClass.isAssignableFrom(newToken.getClass()))
110 {
111 Map<String, LstToken> tokenMap = getTokenMap(tokClass);
112 LstToken test = tokenMap.put(newToken.getTokenName(), newToken);
113
114 if (test != null)
115 {
116 Logging.errorPrint("More than one " + tokClass.getName() + " has the same token name: '"
117 + newToken.getTokenName() + "'. " + "Classes were " + test.getClass().getName() + " and "
118 + newToken.getClass().getName());
119 }
120 }
121 }
122 }
123
124 /**
125 * Get the token map

Callers 1

loadPluginMethod · 0.95

Calls 5

getTokenMapMethod · 0.95
errorPrintMethod · 0.95
putMethod · 0.65
getTokenNameMethod · 0.65
getNameMethod · 0.65

Tested by

no test coverage detected