org.openl.codegen.functions.tools.GenMathUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.openl.rules.gen Show documentation
Show all versions of org.openl.rules.gen Show documentation
OpenL Code generation project
package org.openl.codegen.functions.tools;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.ArrayUtils;
import org.openl.codegen.tools.CodeGenTools;
import org.openl.codegen.tools.VelocityTool;
import org.openl.util.math.MathUtils;
/**
* Generator functions for {@link MathUtils}
*
* @author DLiauchuk
*
*/
public class GenMathUtils extends GenNumberValueFunctions {
private static Class>[] ALL_WRAPPER_TYPES;
public static void main(String[] arg) throws Exception {
new GenMathUtils().run();
}
public void run() throws Exception {
ALL_WRAPPER_TYPES = ArrayUtils.addAll(GenNumberValueFunctions.wrapperNumericTypes,
GenNumberValueFunctions.BIG_NUMERIC_TYPES);
generateMathFunctions();
}
private void generateMathFunctions() throws IOException {
Map variables = new HashMap();
String sourceFilePath = CodeGenTools.getClassSourcePathInCommonsModule(MathUtils.class);
variables.put("tool", new VelocityTool());
variables.put("primitiveTypes", GenNumberValueFunctions.primitiveNumericTypes);
variables.put("wrapperTypes", GenNumberValueFunctions.wrapperNumericTypes);
variables.put("bigNumericTypes", GenNumberValueFunctions.BIG_NUMERIC_TYPES);
variables.put("allWrapperTypes", ALL_WRAPPER_TYPES);
processSourceCode(sourceFilePath, "MathUtils-functions.vm", variables);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy