Package com.google.caja

Examples of com.google.caja.SomethingWidgyHappenedError


                              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


    if (IS_NORMALIZED != null) {
      try {
        return ((Boolean) IS_NORMALIZED.invoke(null, s, NORMAL_FORM_C))
            .booleanValue();
      } catch (IllegalAccessException ex) {
        throw new SomethingWidgyHappenedError(
            "Normalizer unexpectedly uninvokable", ex);
      } catch (InvocationTargetException ex) {
        Throwable th = ex.getTargetException();
          throw new SomethingWidgyHappenedError(
              "Normalizer unexpectedly uninvokable", th);
      }
    }

    // From http://unicode.org/reports/tr15/#D6
View Full Code Here

    try {
      StringBuilder sb = new StringBuilder();
      this.format(context, sb);
      return sb.toString();
    } catch (IOException ex) {
      throw new SomethingWidgyHappenedError(
          "IOException writing to StringBuilder", ex);
    }
  }
View Full Code Here

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

  }
View Full Code Here

      if (len != 0) { snippet.append('\n'); }
      int snippetStart = snippet.length();
      try {
        appendSnippet(pos, snippet);
      } catch (IOException ex) {
        throw new SomethingWidgyHappenedError(
            "StringBuilders shouldn't throw IOExceptions", ex);
      }
      // If no content written by appendSnippet, then remove the newline.
      if (snippet.length() == snippetStart) { snippet.setLength(len); }
    }
View Full Code Here

      List<? extends ParseTreeNode> children) {
    Constructor<T> ctor = findCloneCtor(clazz);
    try {
      return ctor.newInstance(pos, value, children);
    } catch (InstantiationException e) {
      throw new SomethingWidgyHappenedError(
          getCtorErrorMessage(ctor, value, children), e);
    } catch (IllegalAccessException e) {
      throw new SomethingWidgyHappenedError(
          getCtorErrorMessage(ctor, value, children), e);
    } catch (InvocationTargetException e) {
      throw new SomethingWidgyHappenedError(
          getCtorErrorMessage(ctor, value, children), e);
    } catch (IllegalArgumentException e) {
      throw new SomethingWidgyHappenedError(
          getCtorErrorMessage(ctor, value, children), e);
    }
  }
View Full Code Here

          && isReflectiveCtorAnnotated(ctor)) {
        cloneCtorCache.put(clazz, ctor);
        return ctor;
      }
    }
    throw new SomethingWidgyHappenedError(
        "Cannot find clone ctor for node " + clazz);
  }
View Full Code Here

    for (Rule rule : run) {
      try {
        ParseTreeNode result = rule.fire(node, scope);
        if (result != Rule.NONE) {
          if (debug && !rules.applicableTo(node).contains(rule)) {
            throw new SomethingWidgyHappenedError(
                rule.getName() + " should be applicable to " + node);
          }
          if (logging) { logResults(rule, node, result, null); }
          result.makeImmutable();
          return result;
View Full Code Here

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

      } else if (sig instanceof CssPropertySignature.ProgIdSignature) {
        applyProgIdSignature(
            (CssPropertySignature.ProgIdSignature) sig,
            candidate, propertyName, passed);
      } else {
        throw new SomethingWidgyHappenedError(sig.getClass().getName());
      }
    }
    for (Candidate candidate : passed) {
      if (null == best || best.exprIdx < candidate.exprIdx) {
        best = candidate;
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.