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

Method getInfoToken

code/src/java/pcgen/core/PlayerCharacter.java:8066–8094  ·  view source on GitHub ↗
(String token, PObject po)

Source from the content-addressed store, hash-verified

8064 }
8065
8066 public String getInfoToken(String token, PObject po)
8067 {
8068 // looking for a token in the form of RACE.INFO.TAG where
8069 // RACE indicate which token map to check for a INFO label of TAG to return
8070 int i = token.indexOf(".INFO.");
8071 String ts = token;
8072 if (i>-1)
8073 {
8074 ts = token.substring(i + 6);
8075 }
8076 else
8077 {
8078 return token;
8079 }
8080 Set<MapKey<?, ?>> keys = po.getMapKeys();
8081 for (MapKey<?, ?> key : keys)
8082 {
8083 Map<?, ?> key2 = po.getMapFor(key);
8084 for(Object k : key2.keySet())
8085 {
8086 if (k.toString().equalsIgnoreCase(ts))
8087 {
8088 MessageFormat m = (MessageFormat) key2.get(k);
8089 return m.toPattern();
8090 }
8091 }
8092 }
8093 return token;
8094 }
8095
8096
8097 /**

Callers 5

getDescriptionMethod · 0.95
getTokenMethod · 0.80
replaceTokenMethod · 0.80
getHasInfoStringMethod · 0.80
getInfoStringMethod · 0.80

Calls 7

getMapKeysMethod · 0.80
equalsIgnoreCaseMethod · 0.80
indexOfMethod · 0.65
toStringMethod · 0.65
getMethod · 0.65
getMapForMethod · 0.45
keySetMethod · 0.45

Tested by

no test coverage detected