Java Code Examples for com.sun.tools.javac.util.Context#Key
The following examples show how to use
com.sun.tools.javac.util.Context#Key .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JStructPlugin.java From junion with BSD 3-Clause "New" or "Revised" License | 6 votes |
public static void wrapCompiler(Context c) throws Exception { Context.Key<JavaCompiler> compilerKey = read(JavaCompiler.class, "compilerKey"); JavaCompiler comp = c.get(compilerKey); Unsafe u = getUnsafe(); JavaCompilerWrapper jcw = (JavaCompilerWrapper)u.allocateInstance(JavaCompilerWrapper.class); //now gotta copy all the nonstatic fields Class jc = JavaCompiler.class; Field[] fs = jc.getDeclaredFields(); for(Field f : fs) { if(!Modifier.isStatic(f.getModifiers())) { f.setAccessible(true); f.set(jcw, f.get(comp)); } } c.put(compilerKey, (JavaCompiler)null); c.put(compilerKey, (JavaCompiler)jcw); }
Example 2
Source File: CommentCollectingParserFactory.java From EasyMPermission with MIT License | 4 votes |
static Context.Key<ParserFactory> key() { return parserFactoryKey; }
Example 3
Source File: CommentCollectingParserFactory.java From EasyMPermission with MIT License | 4 votes |
static Context.Key<Parser.Factory> key() { return parserFactoryKey; }
Example 4
Source File: CommentCollectingParserFactory.java From EasyMPermission with MIT License | 4 votes |
static Context.Key<ParserFactory> key() { return parserFactoryKey; }