Package com.google.caja

Examples of com.google.caja.SomethingWidgyHappenedError


      try {
        AbstractCajolingHandler.renderAsJSON(
            (String)null, (String)null, contentParams.b, mq, writer, false);
      } catch (IOException e) {
        // Unlikely IOException to byte array; rethrow
        throw new SomethingWidgyHappenedError(e);
      }
      result = FetchedData.fromBytes(
          intermediateResponse.toByteArray(),
          ContentType.JSON.mimeType,
          "UTF-8",
View Full Code Here


      Writer out = new OutputStreamWriter(
          new FileOutputStream(output), Charsets.UTF_8.name());
      try {
        String currentDate = "" + new Date();
        if (currentDate.indexOf("*/") >= 0) {
          throw new SomethingWidgyHappenedError("Date should not contain '*/'");
        }
        out.write("// Copyright Google Inc.\n");
        out.write("// Licensed under the Apache Licence Version 2.0\n");
        out.write("// Autogenerated at " + currentDate + "\n");
        out.write("// @overrides window\n");
View Full Code Here

      DomParser p = new DomParser(new HtmlLexer(cp), false, is, mq);
      //if (p.getTokenQueue().isEmpty()) { return null; }
      input = Dom.transplant(p.parseDocument());
      p.getTokenQueue().expectEmpty();
    } else {
      throw new SomethingWidgyHappenedError("Can't classify input " + is);
    }
    return input;

  }
View Full Code Here

  }

  public static Document makeDocument(
      Function<DOMImplementation, DocumentType> doctypeMaker, String features,
      DOMImplementation domImpl) {
    if (features != null) { throw new SomethingWidgyHappenedError(); }
    if (domImpl == null) {
      domImpl = new CoreDocumentImpl().getImplementation();
    }

    DocumentType doctype = doctypeMaker != null
View Full Code Here

        } else if (STYLE.is(el)) {
          rewriteStyleEl(content);
        } else if (LINK.is(el)) {
          rewriteLinkEl(content);
        } else {
          throw new SomethingWidgyHappenedError(src.getNodeName());
        }
      } else if (BODY_ONLOAD.is((Attr) src)) {
        moveOnLoadHandlerToEndOfBody(content);
      }
      // Attribute extraction handled elsewhere.
View Full Code Here

                p, Collections.<CssTree.Declaration>emptyList());
          }
          return parser.parseDeclarationGroup();
        }
      }
      default: throw new SomethingWidgyHappenedError(type.toString());
    }
  }
View Full Code Here

                      "/* Failed to load "
                      + errUri.replaceAll("\\*/", "* /") + " */",
                      extRef.getReferencePosition());
                  break;
                default:
                  throw new SomethingWidgyHappenedError(t.toString());
              }
            }
            return cp.clone();
          }
        },
View Full Code Here

      StringBuilder sb = new StringBuilder(4);
      char ch = (char) (min + i);
      try {
        hex2Escape(ch, sb);
      } catch (IOException ex) {
        throw new SomethingWidgyHappenedError(
            "StringBuilders don't throw IOException", ex);
      }
      out[i] = new Escape(ch, sb.toString());
    }
    return out;
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

      new File(dir).mkdirs();
      FileOutputStream o = new FileOutputStream(new File(dir, id));
      o.write(data);
      o.close();
    } catch (IOException e) {
      throw new SomethingWidgyHappenedError(e);
    }
  }
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.