Exemplo n.º 1
0
 /** @return The PolymerElement type string for a class definition. */
 private static String getPolymerElementType(final ClassDefinition cls) {
   return SimpleFormat.format(
       "Polymer%sElement",
       cls.nativeBaseElement == null
           ? ""
           : CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_CAMEL, cls.nativeBaseElement));
 }
Exemplo n.º 2
0
 @Override
 protected void reportMessage(
     SourcePosition location, String kind, String format, Object... arguments) {
   String message = SimpleFormat.format("%s", SimpleFormat.format(format, arguments));
   switch (kind) {
     case "Error":
       if (isIdeMode || !errorSeen) {
         errorSeen = true;
         this.reporter.error(message, location.source.name, location.line + 1, location.column);
       }
       break;
     case "Warning":
       this.reporter.warning(message, location.source.name, location.line + 1, location.column);
       break;
     default:
       throw new IllegalStateException("Unexpected:" + kind);
   }
 }