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

com.hframework.common.dyncompile.FileManager Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package com.hframework.common.dyncompile;

import javax.tools.*;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by zhangquanhong on 2017/3/14.
 */
public class FileManager extends ForwardingJavaFileManager {
    protected final Map map = new HashMap();
    public FileManager(JavaCompiler compiler) {
        super(compiler.getStandardFileManager(null, null, null));  }  //取得文件管理器
    @Override
    public Output getJavaFileForOutput
            (Location location, String name, JavaFileObject.Kind kind, FileObject source) {
        Output mc = new Output(name, kind);   //与文件连接
        this.map.put(name, mc);
        return mc;
    }
    public Output getOutput(String name) {
        return map.get(name);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy