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

Method buildDataModel

code/src/java/pcgen/output/publish/OutputDB.java:150–174  ·  view source on GitHub ↗

Builds the PlayerCharacter data model for the given CharID. @param id The CharID for which the data model should be built @return A Map of the data model for the PlayerCharacter identified by the given CharID

(CharID id)

Source from the content-addressed store, hash-verified

148 * given CharID
149 */
150 public static Map<String, Object> buildDataModel(CharID id)
151 {
152 Map<String, Object> input = new HashMap<>();
153 for (Object k1 : outModels.getKeySet())
154 {
155 for (Object k2 : outModels.getSecondaryKeySet(k1))
156 {
157 ModelFactory modelFactory = outModels.get(k1, k2);
158 TemplateModel model = modelFactory.generate(id);
159 String k1String = k1.toString();
160 if ("".equals(k2.toString()))
161 {
162 input.put(k1String, model);
163 }
164 else
165 {
166 ensureMap(input, k1String);
167 @SuppressWarnings("unchecked")
168 Map<Object, Object> m = (Map<Object, Object>) input.get(k1String);
169 m.put(k2.toString(), model);
170 }
171 }
172 }
173 return input;
174 }
175
176 private static void ensureMap(Map<String, Object> input, String k1String)
177 {

Callers 2

Calls 8

generateMethod · 0.95
ensureMapMethod · 0.95
getKeySetMethod · 0.65
getMethod · 0.65
toStringMethod · 0.65
equalsMethod · 0.65
putMethod · 0.65
getSecondaryKeySetMethod · 0.45

Tested by 1