private void initContext() { context.put(JavacTaskImpl.class, this); if (context.get(TaskListener.class) != null) context.put(TaskListener.class, (TaskListener) null); if (taskListener != null) context.put(TaskListener.class, ccw.wrap(taskListener)); // initialize compiler's default locale context.put(Locale.class, locale); }
protected Enter(Context context) { context.put(enterKey, this); log = Log.instance(context); reader = ClassReader.instance(context); make = TreeMaker.instance(context); syms = Symtab.instance(context); chk = Check.instance(context); memberEnter = MemberEnter.instance(context); types = Types.instance(context); annotate = Annotate.instance(context); lint = Lint.instance(context); names = Names.instance(context); predefClassDef = make.ClassDef(make.Modifiers(PUBLIC), syms.predefClass.name, null, null, null, null); predefClassDef.sym = syms.predefClass; todo = Todo.instance(context); fileManager = context.get(JavaFileManager.class); Options options = Options.instance(context); pkginfoOpt = PkgInfo.get(options); }
/** * Construct a JavaFileObject from the given file. * * <p><b>TODO: this method is useless here</b> * * @param file a file * @return a JavaFileObject from the standard file manager. */ public JavaFileObject asJavaFileObject(File file) { JavacFileManager fm = (JavacFileManager) context.get(JavaFileManager.class); return fm.getRegularFile(file); }
public static Enter instance(Context context) { Enter instance = context.get(enterKey); if (instance == null) instance = new Enter(context); return instance; }