Package com.google.caja

Examples of com.google.caja.SomethingWidgyHappenedError


                    ConfigUtil.RESOURCE_RESOLVER, cacheMq)),
            cacheMq.getMessages());
      // If the default schema is borked, there's not much we can do.
      } catch (IOException ex) {
        mq.getMessages().addAll(cacheMq.getMessages());
        throw new SomethingWidgyHappenedError("Default schema is borked", ex);
      } catch (ParseException ex) {
        cacheMq.getMessages().add(ex.getCajaMessage());
        mq.getMessages().addAll(cacheMq.getMessages());
        throw new SomethingWidgyHappenedError("Default schema is borked", ex);
      }
    }
    mq.getMessages().addAll(defaultSchema.b);
    return defaultSchema.a;
  }
View Full Code Here


        fnDefs = ConfigUtil.loadWhiteListFromJson(
            defaultFnWhitelistURL, ConfigUtil.RESOURCE_RESOLVER, cacheMq);
      // If the default schema is borked, there's not much we can do.
      } catch (IOException ex) {
        mq.getMessages().addAll(cacheMq.getMessages());
        throw new SomethingWidgyHappenedError("Default schema is borked", ex);
      } catch (ParseException ex) {
        ex.toMessageQueue(cacheMq);
        mq.getMessages().addAll(cacheMq.getMessages());
        throw new SomethingWidgyHappenedError("Default schema is borked", ex);
      }
      defaultSchema = Pair.pair(
          new CssSchema(propDefs, fnDefs), cacheMq.getMessages());
    }
    mq.getMessages().addAll(defaultSchema.b);
View Full Code Here

   */
  private static CssPropertySignature parseSignature(Name name, String sig) {
    try {
      return CssPropertySignature.Parser.parseSignature(sig);
    } catch (RuntimeException ex) {
      throw new SomethingWidgyHappenedError(
          "Error parsing symbol " + name + " with signature " + sig, ex);
    }
  }
View Full Code Here

    }
    builder.setDoctypeExpectation(DoctypeExpectation.NO_DOCTYPE_ERRORS);
    try {
      builder.startTokenization(new Tokenizer(builder));
    } catch (SAXException ex) {
      throw new SomethingWidgyHappenedError(ex);
    }
    builder.setErrorHandler(
        new ErrorHandler() {
          private FilePosition lastPos;
          private String lastMessage;
View Full Code Here

        if (hasXmlns) { attrs.add(XMLNS_ATTR_MARKER); }
        builder.startTag(
            elName, toHtmlAttributes(attrs, htmlAttrs), end.text.equals("/>"));
      }
    } catch (SAXException ex) {
      throw new SomethingWidgyHappenedError(ex);
    }
  }
View Full Code Here

    }
    builder.setTokenContext(textToken, textToken);
    try {
      builder.characters(chars, 0, n);
    } catch (SAXException ex) {
      throw new SomethingWidgyHappenedError(ex);
    }
  }
View Full Code Here

  public void render(RenderContext rc) {
    TokenConsumer out = rc.getOut();
    out.mark(getFilePosition());
    if (children().isEmpty()) {
      throw new SomethingWidgyHappenedError("Empty MultiDeclaration");
    }
    out.consume("var");
    boolean seen = false;
    for (Declaration decl : children()) {
      if (seen) {
View Full Code Here

   * @return a new parse tree node resulting from the substitution.
   * @see #subst(String, java.util.Map)
   */
  public static ParseTreeNode substV(String patternText, Object... args) {
    if (args.length % 2 != 0) {
      throw new SomethingWidgyHappenedError("Wrong # of args for subst()");
    }
    Map<String, ParseTreeNode> bindings = makeBindings();
    for (int i = 0; i < args.length; i += 2) {
      ParseTreeNode value = (ParseTreeNode) args[i + 1];
      if (value != null) {
View Full Code Here

      try {
        patternCache.put(
            patternText,
            QuasiBuilder.parseQuasiNode(patternText));
      } catch (ParseException e) {
        throw new SomethingWidgyHappenedError("Pattern programming error", e);
      }
    }
    return patternCache.get(patternText);
  }
View Full Code Here

  private static void pctEncode(char ch, StringBuilder out) {
    try {
      Escaping.pctEncode(ch, out);
    } catch (IOException ex) {
      throw new SomethingWidgyHappenedError(
          "StringBuilders shouldn't throw IOException", ex);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.caja.SomethingWidgyHappenedError

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.