Package com.google.caja.reporting

Examples of com.google.caja.reporting.MessageContext


    return scriptElement;
  }

  private void logException(Exception cause, MessageQueue mq) {
    StringBuilder errbuilder = new StringBuilder();
    MessageContext mc = new MessageContext();
    if (cause != null) {
      errbuilder.append(cause).append('\n');
    }
    for (Message m : mq.getMessages()) {
      errbuilder.append(m.format(mc)).append('\n');
View Full Code Here


    }
   
    boolean passed = false;

    MessageQueue mq = new SimpleMessageQueue();
    MessageContext mc = new MessageContext();
    Uri contextUri = req.getUri();
    InputSource is = new InputSource(contextUri.toJavaUri());

    PluginMeta pluginMeta = new PluginMeta(
            proxyFetcher(req, contextUri), proxyUriPolicy(req));
View Full Code Here

      out.append(String.valueOf(this.endCharInLine()));
    }
  }

  public final void formatShort(Appendable out) throws IOException {
    MessageContext mc = new MessageContext();
    InputSource is = source();
    mc.addInputSource(is);
    out.append(mc.abbreviate(is))
        .append(":")
        .append(String.valueOf(this.startLineNo()));
  }
View Full Code Here

  /** debugging */
  private static String dump(ParseTreeNode node) {
    check(node);
    StringBuilder sb = new StringBuilder();
    MessageContext mc = new MessageContext();
    mc.relevantKeys
        = Collections.<SyntheticAttributeKey<Integer>>singleton(NUM);
    try {
      node.formatTree(mc, 2, sb);
    } catch (java.io.IOException ex) {
View Full Code Here

  // TODO(jasvir): Outline this and all the other examples of cajole
  // into a more usable api for the cajoler
  public CajolingServiceResult cajole(
      String base, String url, String input,
      boolean debugMode, String opt_idClass) {
    MessageContext mc = new MessageContext();
    MessageQueue mq = new SimpleMessageQueue();

    ParseTreeNode outputJs;
    Node outputHtml;
View Full Code Here

        if (delta != 0) { return delta; }
        delta = Long.signum(aEPos - bEPos);
        if (delta != 0) { return delta; }

        StringBuilder aBuf = new StringBuilder(), bBuf = new StringBuilder();
        MessageContext mc = new MessageContext();
        try {
          a0.format(mc, aBuf);
          b0.format(mc, bBuf);
        } catch (IOException ex) {
          throw new RuntimeException(ex);
View Full Code Here

  private long slowestTime = 0;
  private String slowestStage = "nothing";

  public PluginCompiler(BuildInfo buildInfo, PluginMeta meta, MessageQueue mq) {
    this.buildInfo = buildInfo;
    this.jobs = new Jobs(new MessageContext(), mq, meta);
    this.cssSchema = CssSchema.getDefaultCss21Schema(mq);
    this.htmlSchema = HtmlSchema.getDefault(mq);
    this.jobCache = new StubJobCache();
    this.preconditions = PipelineMaker.DEFAULT_PRECONDS;
    this.goals = PipelineMaker.DEFAULT_GOALS;
View Full Code Here

  public static String render(MessageQueue mq) {
    StringBuilder sb = new StringBuilder();
    for (Message m : mq.getMessages()) {
      try {
        m.format(new MessageContext(), sb);
      } catch (IOException e) {
        sb.append(e.toString());
      }
      sb.append("\n");
    }
View Full Code Here

    this.ignores = ignores;
  }

  public boolean build(List<File> inputs, List<File> dependencies,
      Map<String, Object> options, File output) throws IOException {
    MessageContext mc = new MessageContext();
    Map<InputSource, CharSequence> contentMap = Maps.newLinkedHashMap();
    MessageQueue mq = new SimpleMessageQueue();
    List<LintJob> lintJobs = parseInputs(inputs, contentMap, mc, mq);
    lint(lintJobs, env, mq);
    if (!ignores.isEmpty()) {
View Full Code Here

      };
    } else {
      policy = prePolicy;
    }

    MessageContext mc = new MessageContext();

    String language = (String) options.get("language");
    String rendererType = (String) options.get("renderer");

    if ("javascript".equals(language) && "concat".equals(rendererType)) {
View Full Code Here

TOP

Related Classes of com.google.caja.reporting.MessageContext

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.