Package com.sun.tools.javac.util

Examples of com.sun.tools.javac.util.Context$Key


                                 Iterable<String> classes,
                                 Iterable<? extends JavaFileObject> compilationUnits) {
    ErrorProneOptions errorProneOptions = ErrorProneOptions.processArgs(ArrayUtil.toStringArray(ContainerUtil.toCollection(options)));
    List<String> remainingOptions = Arrays.asList(errorProneOptions.getRemainingArgs());
    CompilationTask task = myJavacTool.getTask(out, fileManager, diagnosticListener, remainingOptions, classes, compilationUnits);
    Context context = ((JavacTaskImpl)task).getContext();
    try {
      ErrorProneScanner scanner = new ErrorProneScanner(ErrorProneScanner.EnabledPredicate.DEFAULT_CHECKS);
      Method setDisabledChecks = ErrorProneScanner.class.getDeclaredMethod("setDisabledChecks", Set.class);
      setDisabledChecks.setAccessible(true);
      setDisabledChecks.invoke(scanner, errorProneOptions.getDisabledChecks());
      context.put(Scanner.class, scanner);
    }
    catch (InvocationTargetException e) {
      throw new RuntimeException(e.getTargetException());
    }
    catch (Exception e) {
View Full Code Here


   * @param simpleOptions options of the javadoc generation
   * @return the root doc of the files
   */
  public static RootDoc createJavadoc(File sourcedir, ListBuffer<String> javaNames, ListBuffer<String> subPackages, Map<String,String> simpleOptions) throws Exception{

    Context context = new Context();
   
      Options options = Options.instance(context);
      options.put(OPTION_SOURCEPATH, sourcedir.getAbsolutePath());
      ListBuffer<String[]> optionList = new ListBuffer<String[]>();
      optionList.append(new String[]{OPTION_SOURCEPATH, sourcedir.getAbsolutePath()});
View Full Code Here

   * @param simpleOptions options of the javadoc generation
   * @return the root doc of the files
   */
  public static RootDoc createJavadoc(File sourcedir, ListBuffer<String> javaNames, ListBuffer<String> subPackages, Map<String,String> simpleOptions) throws Exception{

    Context context = new Context();
   
      Options options = Options.instance(context);
    options.put(OptionName.SOURCEPATH, sourcedir.getAbsolutePath());
    // TODO make the encoding more flexible
    String encoding = IoBoostUtils.UTF_8;
View Full Code Here

      ObjectAnalyzer<Messager> messagerAnalyzer = new ObjectAnalyzer<Messager>(
          messager);
      String programName = messagerAnalyzer
          .getPrivateField("programName");
      if (newMessager == null)
        newMessager = MessagerBooster.preRegister(new Context(),
            programName, MessagerBoosterConfiguration
                .createGlueboosterConfiguration());
      docEnvAnalyzer.setPrivateField("messager", newMessager);
      singleton.getLog().debug("replaced DocEnv Messager");
View Full Code Here

            } else if (System.getProperty("useJavaUtilZip") != null) {
                System.getProperties().remove("useJavaUtilZip");
                resetProperties = true;
            }

            Context c = new Context();
            if (!useSymbolFile) {
                Options options = Options.instance(c);
                options.put("ignore.symbol.file", "true");
            }
View Full Code Here

          PrintWriter errWriter,
          PrintWriter warnWriter,
          PrintWriter noticeWriter,
          String defaultDocletClassName,
          ClassLoader docletParentClassLoader) {
        context = new Context();
        messager = new Messager(context, programName, errWriter, warnWriter, noticeWriter);
        this.defaultDocletClassName = defaultDocletClassName;
        this.docletParentClassLoader = docletParentClassLoader;
    }
View Full Code Here

        this(programName, defaultDocletClassName, null);
    }

    Start(String programName, String defaultDocletClassName,
          ClassLoader docletParentClassLoader) {
        context = new Context();
        messager = new Messager(context, programName);
        this.defaultDocletClassName = defaultDocletClassName;
        this.docletParentClassLoader = docletParentClassLoader;
    }
View Full Code Here

        File outDir = new File(testName);
        outDir.mkdirs();
        compile(outDir, opts);

        Context ctx = new Context();
        JavacFileManager fm = new JavacFileManager(ctx, true, null);
        fm.setLocation(StandardLocation.CLASS_PATH, Arrays.asList(outDir));
        ClassReader cr = ClassReader.instance(ctx);
        cr.saveParameterNames = true;
        Name.Table names = Name.Table.instance(ctx);
View Full Code Here

            } else if (System.getProperty("useJavaUtilZip") != null) {
                System.getProperties().remove("useJavaUtilZip");
                resetProperties = true;
            }

            Context c = new Context();
            return new JavacFileManager(c, false, null);
        } finally {
            if (resetProperties) {
                if (prev == null) {
                    System.getProperties().remove("useJavaUtilZip");
View Full Code Here

            } else if (System.getProperty("useJavaUtilZip") != null) {
                System.getProperties().remove("useJavaUtilZip");
                resetProperties = true;
            }

            Context c = new Context();
            if (!useSymbolFile) {
                Options options = Options.instance(c);
                options.put("ignore.symbol.file", "true");
            }
View Full Code Here

TOP

Related Classes of com.sun.tools.javac.util.Context$Key

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.