List of usage examples for org.apache.commons.jci.readers MemoryResourceReader MemoryResourceReader
MemoryResourceReader
From source file:org.drools.compiler.PackageBuilder.java
/** * This allows you to pass in a pre existing package, and a configuration (for instance to set the classloader). * @param pkg A pre existing package (can be null if none exists) * @param configuration Optional configuration for this builder. *//* w w w .ja v a2 s . com*/ public PackageBuilder(final Package pkg, PackageBuilderConfiguration configuration) { if (configuration == null) { configuration = new PackageBuilderConfiguration(); } this.configuration = configuration; loadCompiler(); this.src = new MemoryResourceReader(); this.results = new ArrayList(); this.errorHandlers = new HashMap(); this.pkg = pkg; this.generatedClassList = new ArrayList(); this.classFieldExtractorCache = new ClassFieldExtractorCache(); if (pkg != null) { this.packageStoreWrapper = new PackageStore(pkg.getPackageCompilationData()); } }
From source file:org.xchain.framework.jsl.TemplateCompiler.java
public void init(ClassLoader classLoader) { this.templateClassLoader = new TemplateClassLoader(classLoader); resourceReader = new WrappedResourceReader(new MemoryResourceReader(), templateClassLoader); settings = new JavaCompilerSettings(); settings.setSourceVersion(SOURCE_VERSION); settings.setSourceEncoding(SOURCE_ENCODING); settings.setTargetVersion(TARGET_VERSION); compiler = new JavaCompilerFactory().createCompiler("eclipse"); }