com.google.javascript.jscomp.Compiler.setErrorManager()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 JavaScript  
字(3.9k)|赞(0)|评价(0)|浏览(188)

本文整理了Java中com.google.javascript.jscomp.Compiler.setErrorManager()方法的一些代码示例,展示了Compiler.setErrorManager()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Compiler.setErrorManager()方法的具体详情如下:
包路径:com.google.javascript.jscomp.Compiler
类名称:Compiler
方法名:setErrorManager

Compiler.setErrorManager介绍

[英]Sets the error manager.
[中]设置错误管理器。

代码示例

代码示例来源:origin: com.google.javascript/closure-compiler

/**
 * Creates a Compiler that uses a custom error manager.
 */
public Compiler(ErrorManager errorManager) {
 this();
 setErrorManager(errorManager);
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

/**
 * Creates a Compiler that uses a custom error manager.
 */
public Compiler(ErrorManager errorManager) {
 this();
 setErrorManager(errorManager);
}

代码示例来源:origin: angular/clutz

void setErrorStream(PrintStream errStream) {
 errorManager =
   new GentsErrorManager(
     errStream, ErrorFormat.MULTILINE.toFormatter(compiler, true), opts.debug);
 compiler.setErrorManager(errorManager);
}

代码示例来源:origin: com.google.javascript/closure-compiler

private Compiler createCompiler(CompilerOptions options) {
 Compiler compiler = new Compiler();
 MessageFormatter formatter =
   options.getErrorFormat().toFormatter(compiler, false);
 AntErrorManager errorManager = new AntErrorManager(formatter, this);
 compiler.setErrorManager(errorManager);
 return compiler;
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

private Compiler createCompiler(CompilerOptions options) {
 Compiler compiler = new Compiler();
 MessageFormatter formatter =
   options.getErrorFormat().toFormatter(compiler, false);
 AntErrorManager errorManager = new AntErrorManager(formatter, this);
 compiler.setErrorManager(errorManager);
 return compiler;
}

代码示例来源:origin: com.google.javascript/closure-compiler

/** @return Whether any fixes were applied. */
 private static boolean fix(String filename, ImmutableSet<DiagnosticType> unfixableErrors)
   throws IOException {
  Compiler compiler = new Compiler(System.out);
  FixingErrorManager errorManager = new FixingErrorManager(unfixableErrors);
  compiler.setErrorManager(errorManager);
  errorManager.setCompiler(compiler);

  lint(Paths.get(filename), compiler);

  Collection<SuggestedFix> fixes = errorManager.getSureFixes();
  if (!fixes.isEmpty()) {
   ApplySuggestedFixes.applySuggestedFixesToFiles(fixes);
   return true;
  }
  return false;
 }
}

代码示例来源:origin: com.google.javascript/closure-compiler

try {
 compiler.setErrorManager(
   new ThreadSafeDelegatingErrorManager(oldErrorManager) {
    @Override
 check.process(externs, ast);
} finally {
 compiler.setErrorManager(oldErrorManager);

代码示例来源:origin: org.scala-js/closure-compiler-java-6

/**
 * Initializes the compiler options. It's called as part of a normal compile() job.
 * Public for the callers that are not doing a normal compile() job.
 */
public void initOptions(CompilerOptions options) {
 this.options = options;
 this.languageMode = options.getLanguageIn();
 if (errorManager == null) {
  if (outStream == null) {
   setErrorManager(
     new LoggerErrorManager(createMessageFormatter(), logger));
  } else {
   PrintStreamErrorManager printer =
     new PrintStreamErrorManager(createMessageFormatter(), outStream);
   printer.setSummaryDetailLevel(options.summaryDetailLevel);
   setErrorManager(printer);
  }
 }
 reconcileOptionsWithGuards();
 if (options.legacyCodeCompile) {
  options.disambiguateProperties = false;
  options.ambiguateProperties = false;
  options.useNonStrictWarningsGuard();
 }
 initWarningsGuard(options.getWarningsGuard());
}

代码示例来源:origin: com.google.javascript/closure-compiler

JsonErrorReportGenerator errorGenerator =
  new JsonErrorReportGenerator(getErrorPrintStream(), compiler);
compiler.setErrorManager(new SortingErrorManager(ImmutableSet.of(errorGenerator)));

代码示例来源:origin: com.google.javascript/closure-compiler

if (errorManager == null) {
 if (this.outStream == null) {
  setErrorManager(
    new LoggerErrorManager(createMessageFormatter(), logger));
 } else {
      createMessageFormatter(), this.outStream, options.summaryDetailLevel));
  builder.addAll(options.getExtraReportGenerators());
  setErrorManager(new SortingErrorManager(builder.build()));

代码示例来源:origin: prezi/spaghetti

compiler.setErrorManager(new FilteringErrorManager(
  options.errorFormat.toFormatter(compiler, true),
  System.err

相关文章

Compiler类方法