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

Method generateFormulaManager

code/src/java/plugin/lsttokens/ModifyLst.java:169–184  ·  view source on GitHub ↗
(LoadContext context, PCGenScope scope)

Source from the content-addressed store, hash-verified

167 }
168
169 private final FormulaManager generateFormulaManager(LoadContext context, PCGenScope scope)
170 {
171 FormulaManager formulaManager =
172 context.getVariableContext().getFormulaManager();
173 Optional<FormatManager<?>> formatManager = scope.getFormatManager(context);
174 if (formatManager.isEmpty())
175 {
176 //Okay, we won't add this()
177 return formulaManager;
178 }
179 //Note: Passing new Object() as DefinedValue is a dummy
180 FunctionLibrary functionLibrary = new DefinedWrappingLibrary(
181 formulaManager.get(FormulaManager.FUNCTION), "this", new Object(),
182 formatManager.get());
183 return formulaManager.getWith(FormulaManager.FUNCTION, functionLibrary);
184 }
185
186 @Override
187 public String[] unparse(LoadContext context, VarContainer obj)

Callers 1

parseNonEmptyTokenMethod · 0.95

Calls 6

getVariableContextMethod · 0.65
getFormatManagerMethod · 0.65
isEmptyMethod · 0.65
getMethod · 0.65
getFormulaManagerMethod · 0.45
getWithMethod · 0.45

Tested by

no test coverage detected