/** * Factory method for compiler instances. The returned SpelCompiler will * attach a class loader as the child of the given class loader and this * child will be used to load compiled expressions. * @param classLoader the ClassLoader to use as the basis for compilation * @return a corresponding SpelCompiler instance */ public static SpelCompiler getCompiler(@Nullable ClassLoader classLoader) { ClassLoader clToUse = (classLoader != null ? classLoader : ClassUtils.getDefaultClassLoader()); synchronized (compilers) { SpelCompiler compiler = compilers.get(clToUse); if (compiler == null) { compiler = new SpelCompiler(clToUse); compilers.put(clToUse, compiler); } return compiler; } }
/** * Factory method for compiler instances. The returned SpelCompiler will * attach a class loader as the child of the given class loader and this * child will be used to load compiled expressions. * @param classLoader the ClassLoader to use as the basis for compilation * @return a corresponding SpelCompiler instance */ public static SpelCompiler getCompiler(@Nullable ClassLoader classLoader) { ClassLoader clToUse = (classLoader != null ? classLoader : ClassUtils.getDefaultClassLoader()); synchronized (compilers) { SpelCompiler compiler = compilers.get(clToUse); if (compiler == null) { compiler = new SpelCompiler(clToUse); compilers.put(clToUse, compiler); } return compiler; } }
/** * Factory method for compiler instances. The returned SpelCompiler will * attach a class loader as the child of the given class loader and this * child will be used to load compiled expressions. * @param classLoader the ClassLoader to use as the basis for compilation * @return a corresponding SpelCompiler instance */ public static SpelCompiler getCompiler(@Nullable ClassLoader classLoader) { ClassLoader clToUse = (classLoader != null ? classLoader : ClassUtils.getDefaultClassLoader()); synchronized (compilers) { SpelCompiler compiler = compilers.get(clToUse); if (compiler == null) { compiler = new SpelCompiler(clToUse); compilers.put(clToUse, compiler); } return compiler; } }