本文整理汇总了Java中com.sun.tools.javac.file.CacheFSInfo类的典型用法代码示例。如果您正苦于以下问题:Java CacheFSInfo类的具体用法?Java CacheFSInfo怎么用?Java CacheFSInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CacheFSInfo类属于com.sun.tools.javac.file包,在下文中一共展示了CacheFSInfo类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStandardFileManager
import com.sun.tools.javac.file.CacheFSInfo; //导入依赖的package包/类
@Override @DefinedBy(Api.COMPILER)
public JavacFileManager getStandardFileManager(
DiagnosticListener<? super JavaFileObject> diagnosticListener,
Locale locale,
Charset charset) {
Context context = new Context();
context.put(Locale.class, locale);
if (diagnosticListener != null)
context.put(DiagnosticListener.class, diagnosticListener);
PrintWriter pw = (charset == null)
? new PrintWriter(System.err, true)
: new PrintWriter(new OutputStreamWriter(System.err, charset), true);
context.put(Log.errKey, pw);
CacheFSInfo.preRegister(context);
return new JavacFileManager(context, true, charset);
}
示例2: getStandardFileManager
import com.sun.tools.javac.file.CacheFSInfo; //导入依赖的package包/类
@Override @DefinedBy(Api.COMPILER)
public JavacFileManager getStandardFileManager(
DiagnosticListener<? super JavaFileObject> diagnosticListener,
Locale locale,
Charset charset) {
Context context = new Context();
context.put(Locale.class, locale);
if (diagnosticListener != null)
context.put(DiagnosticListener.class, diagnosticListener);
PrintWriter pw = (charset == null)
? new PrintWriter(System.err, true)
: new PrintWriter(new OutputStreamWriter(System.err, charset), true);
context.put(Log.outKey, pw);
CacheFSInfo.preRegister(context);
return new JavacFileManager(context, true, charset);
}
示例3: testCacheEnabled
import com.sun.tools.javac.file.CacheFSInfo; //导入依赖的package包/类
@Test
void testCacheEnabled() throws IOException {
String[] args = { };
String[] files = { "C.java"};
TestResult tr = runMain(args, files);
FSInfo info = tr.context.get(FSInfo.class);
if (!(info instanceof CacheFSInfo))
error("unexpected FSInfo; found " + info.getClass() + ", expected CacheFSInfo");
}
示例4: testCacheDisabled
import com.sun.tools.javac.file.CacheFSInfo; //导入依赖的package包/类
@Test
void testCacheDisabled() throws IOException {
writeFile("C.java", "class C { }");
String[] args = { "-XDnonBatchMode" };
String[] files = { "C.java"};
TestResult tr = runMain(args, files);
FSInfo info = tr.context.get(FSInfo.class);
if (info instanceof CacheFSInfo)
error("unexpected CacheFSInfo found");
}
示例5: getContext
import com.sun.tools.javac.file.CacheFSInfo; //导入依赖的package包/类
private static Context getContext() {
Context context = new Context();
CacheFSInfo.preRegister(context);
return context;
}