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

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

package org.voovan.tools.compiler;

import javax.tools.SimpleJavaFileObject;
import java.net.URI;

/**
 * 内存源码保存对象
 * @author helyho
 * 
 * Voovan Framework.
 * WebSite: https://github.com/helyho/Voovan
 * Licence: Apache v2 License
 */
public class JavaMemSource  extends SimpleJavaFileObject{

	private String code;
	
	
	public JavaMemSource(String name,String code) {
		super(URI.create("string:///" + name.replace('.', '/')+ Kind.SOURCE.extension),Kind.SOURCE);
		this.code = code;
	}
	
	@Override 
	public CharSequence getCharContent(boolean ignoreEncodingErrors) { 
		return code; 
	} 

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy