Add the new token to the token map @param newToken
(LstToken newToken)
| 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 |
no test coverage detected