コード例 #1
0
ファイル: PolymerPass.java プロジェクト: chone/plovr
 /** @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));
 }
コード例 #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);
   }
 }