Package com.google.caja

Examples of com.google.caja.SomethingWidgyHappenedError


  public String toStringDeep(int d) {
    StringBuilder sb = new StringBuilder();
    try {
      formatTree(new MessageContext(), d, sb);
    } catch (IOException ex) {
      throw new SomethingWidgyHappenedError(
          "StringBuilders shouldn't throw IOExceptions");
    }
    return sb.toString();
  }
View Full Code Here


        s = new SwitchStmt(posFrom(start), label, switchValue, cases);
        break;
      }
      default:
        throw new SomethingWidgyHappenedError(t.text);
    }
    return s;
  }
View Full Code Here

                              t.pos, MessagePart.Factory.valueOf(t.text)));
            }
            left = Operation.create(posFrom(left), op, left);
            break;
          default:
            throw new SomethingWidgyHappenedError();
      }
    }
    return left;
  }
View Full Code Here

  private static void generateSourceText(HtmlSchema schema, Writer out)
      throws IOException {
    String currentDate = "" + new Date();
    if (currentDate.indexOf("\n") >= 0) {
      throw new SomethingWidgyHappenedError("Date should not contain newline");
    }
    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

        inspectCall((CssPropertySignature.CallSignature) sig);
      } else if (sig instanceof CssPropertySignature.ProgIdSignature) {
        // Ignore.  progid is of interest for old versions of IE and should
        // probably be obsoleted.
      } else {
        throw new SomethingWidgyHappenedError(
            sig + " : " + sig.getClass().getSimpleName());
      }
    }
View Full Code Here

    private void inspectRef(CssPropertySignature.PropertyRefSignature sig) {
      Name propertyName = sig.getPropertyName();
      if (refsUsed.incr(propertyName.getCanonicalForm()) == 0) {
        CssSchema.CssPropertyInfo p = schema.getCssProperty(propertyName);
        if (p == null) {
          throw new SomethingWidgyHappenedError(
              "Unsatisfied reference " + propertyName);
        }
        inspectSig(p.sig);
      }
    }
View Full Code Here

      Name symbolName = sig.getValue();
      CssSchema.SymbolInfo s = schema.getSymbol(symbolName);
      if (s != null) {
        inspectSig(s.sig);
      } else if (!inspectBuiltin(symbolName)) {
        throw new SomethingWidgyHappenedError(
            "unknown CSS symbol " + symbolName);
      }
    }
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

      return immutable((JSONArray) obj);
    } else if (obj == null || obj instanceof Boolean || obj instanceof Number
               || obj instanceof String) {
      return obj;
    } else {
      throw new SomethingWidgyHappenedError(obj.getClass().getSimpleName());
    }
  }
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

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.