class KiePMMLTreeModelFactory {

    public static KiePMMLTreeModel getKiePMMLTreeModel(final DataDictionary dataDictionary, final TransformationDictionary transformationDictionary, final TreeModel model, final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap) throws IllegalAccessException, InstantiationException {
        logger.trace("getKiePMMLTreeModel {}", model);
        String className = getSanitizedClassName(model.getModelName());
        String packageName = getSanitizedPackageName(className);
        Map<String, String> sourcesMap = getKiePMMLTreeModelSourcesMap(dataDictionary, transformationDictionary, model, fieldTypeMap, packageName);
        String fullClassName = packageName + "." + className;
        final Map<String, Class<?>> compiledClasses = KieMemoryCompiler.compile(sourcesMap, Thread.currentThread().getContextClassLoader());
        return (KiePMMLTreeModel) compiledClasses.get(fullClassName).newInstance();
    }

    private  KiePMMLTreeModelFactory();

}