All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.voovan.tools.compiler.MemFileManager Maven / Gradle / Ivy

There is a newer version: 4.3.8
Show newest version
package org.voovan.tools.compiler;

import javax.tools.FileObject;
import javax.tools.ForwardingJavaFileManager;
import javax.tools.JavaFileManager;
import javax.tools.JavaFileObject;
import java.io.IOException;

/**
 * 内存文件管理实现
 * @author helyho
 * 
 * Voovan Framework.
 * WebSite: https://github.com/helyho/Voovan
 * Licence: Apache v2 License
 */
public class MemFileManager extends ForwardingJavaFileManager {

	private JavaMemClass javaMemClass;
	private ClassLoader classLoader;

	protected MemFileManager(JavaFileManager fileManager, ClassLoader classLoader) {
		super(fileManager);
		this.classLoader = classLoader;
	}
	
	public JavaMemClass getJavaMemClass() {
		return javaMemClass;
	}
	
	@Override
	public JavaFileObject getJavaFileForOutput(Location location,
            String className,
            JavaFileObject.Kind kind,
            FileObject sibling)
     throws IOException{
		javaMemClass = new JavaMemClass(className, kind, classLoader);
		return javaMemClass;
		
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy