Package com.google.caja.reporting

Examples of com.google.caja.reporting.MessageContext


    }

    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


      ParseTreeNode root, boolean es53, boolean debug) {
    UriFetcher fetcher = makeFetcher(gadgetUri, container);
    UriPolicy policy = makePolicy(gadgetUri);
    URI javaGadgetUri = gadgetUri.toJavaUri();
    MessageQueue mq = new SimpleMessageQueue();
    MessageContext context = new MessageContext();
    PluginMeta meta = new PluginMeta(fetcher, policy);
    PluginCompiler compiler = makePluginCompiler(meta, mq);
    compiler.setMessageContext(context);
    if (moduleCache != null) {
      compiler.setJobCache(new ModuleCache(moduleCache));
View Full Code Here

    body.appendChild(el);
  }

  private Element formatErrors(Document doc, InputSource is,
      CharSequence orig, List<Message> messages, boolean visible) {
    MessageContext mc = new MessageContext();
    Map<InputSource, CharSequence> originalSrc = Maps.newHashMap();
    originalSrc.put(is, orig);
    mc.addInputSource(is);
    SnippetProducer sp = new SnippetProducer(originalSrc, mc);

    Element errElement = doc.createElement("ul");
    // Style defined in gadgets.css
    errElement.setAttribute("class", "gadgets-messages");
View Full Code Here

    return scriptElement;
  }

  private void logException(String methodname, List<Message> messages) {
    StringBuilder errbuilder = new StringBuilder();
    MessageContext mc = new MessageContext();
    for (Message m : messages) {
      errbuilder.append(m.format(mc)).append('\n');
    }
    if (LOG.isLoggable(Level.INFO)) {
      LOG.logp(Level.INFO, CLASS_NAME, methodname, MessageKeys.UNABLE_TO_CAJOLE,
View Full Code Here

      content.setContent(tameCajaClientApi() + output);
    }
  }

  private String messagesToHtml(InputSource is, CharSequence orig, MessageQueue mq) {
    MessageContext mc = new MessageContext();
    Map<InputSource, CharSequence> originalSrc = Maps.newHashMap();
    originalSrc.put(is, orig);
    mc.addInputSource(is);
    SnippetProducer sp = new SnippetProducer(originalSrc, mc);

    StringBuilder messageText = new StringBuilder();
    messageText.append("<pre>");
    for (Message msg : mq.getMessages()) {
View Full Code Here

      "</script>";
  }

    private void throwCajolingException(Exception cause, MessageQueue mq) {
    StringBuilder errbuilder = new StringBuilder();
    MessageContext mc = new MessageContext();

    if (cause != null) {
      errbuilder.append(cause).append('\n');
    }
View Full Code Here

  }

  /** Serialize a stylesheet to a Writer. */
  public void serialize(CssTree.StyleSheet styleSheet, Writer writer) {
    CssPrettyPrinter cssPrinter = new CssPrettyPrinter(writer, null);
    styleSheet.render(new RenderContext(new MessageContext(), cssPrinter));
    cssPrinter.noMoreTokens();
  }
View Full Code Here

    body.appendChild(el);
  }

  private Element formatErrors(Document doc, InputSource is,
      CharSequence orig, MessageQueue mq) {
    MessageContext mc = new MessageContext();
    Map<InputSource, CharSequence> originalSrc = Maps.newHashMap();
    originalSrc.put(is, orig);
    mc.addInputSource(is);
    SnippetProducer sp = new SnippetProducer(originalSrc, mc);

    StringBuilder messageText = new StringBuilder();
    for (Message msg : mq.getMessages()) {
      // Ignore LINT messages
View Full Code Here

    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

        // Make sure it shows up in the junit test runner trace.
        System.err.println("junit.seed=" + SEED);
      }
    }
    this.is = new InputSource(URI.create("http://example.org/" + getName()));
    this.mc = new MessageContext();
    mc.addInputSource(is);
    this.mq = TestUtil.createTestMessageQueue(this.mc);
  }
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.