Ejemplo n.º 1
0
 /** output-wrapper can also be an array of strings that will be concatenated together. */
 @Override
 public void apply(JsonArray outputWrapperParts, Config.Builder builder) {
   StringBuilder outputWrapper = new StringBuilder();
   for (JsonElement item : outputWrapperParts) {
     outputWrapper.append(GsonUtil.stringOrNull(item));
   }
   apply(outputWrapper.toString(), builder);
 }
Ejemplo n.º 2
0
 @Override
 public void apply(JsonArray functions, Config.Builder builder) {
   for (JsonElement item : functions) {
     String function = GsonUtil.stringOrNull(item);
     if (function != null) {
       apply(function, builder);
     }
   }
 }
Ejemplo n.º 3
0
 @Override
 public void apply(JsonArray properties, Config.Builder builder) {
   for (JsonElement item : properties) {
     String property = GsonUtil.stringOrNull(item);
     if (property != null) {
       apply(property, builder);
     }
   }
 }
Ejemplo n.º 4
0
 @Override
 public void apply(JsonArray inputs, Config.Builder builder) {
   for (JsonElement item : inputs) {
     String define = GsonUtil.stringOrNull(item);
     if (define != null) {
       apply(define, builder);
     }
   }
 }
Ejemplo n.º 5
0
 @Override
 public void apply(JsonArray paths, Config.Builder builder) {
   for (JsonElement item : paths) {
     String path = GsonUtil.stringOrNull(item);
     if (path != null) {
       apply(path, builder);
     }
   }
 }
Ejemplo n.º 6
0
 @Override
 public void apply(JsonArray externs, Config.Builder builder) {
   for (JsonElement item : externs) {
     String extern = GsonUtil.stringOrNull(item);
     if (extern != null) {
       apply(extern, builder);
     }
   }
 }
Ejemplo n.º 7
0
        @Override
        public void apply(JsonArray idGenerators, Config.Builder builder) {
          ImmutableSet.Builder<String> idGeneratorsBuilder = ImmutableSet.builder();
          for (JsonElement item : idGenerators) {
            String idGenerator = GsonUtil.stringOrNull(item);
            if (idGenerator != null) {
              idGeneratorsBuilder.add(idGenerator);
            }
          }

          builder.setIdGenerators(idGeneratorsBuilder.build());
        }
Ejemplo n.º 8
0
        @Override
        public void apply(JsonArray types, Config.Builder builder) {
          ImmutableSet.Builder<String> typesBuilder = ImmutableSet.builder();
          for (JsonElement item : types) {
            String type = GsonUtil.stringOrNull(item);
            if (type != null) {
              typesBuilder.add(type);
            }
          }

          builder.setStripTypePrefixes(typesBuilder.build());
        }
Ejemplo n.º 9
0
        @Override
        public void apply(JsonArray suffixes, Config.Builder builder) {
          ImmutableSet.Builder<String> suffixesBuilder = ImmutableSet.builder();
          for (JsonElement item : suffixes) {
            String suffix = GsonUtil.stringOrNull(item);
            if (suffix != null) {
              suffixesBuilder.add(suffix);
            }
          }

          builder.setStripNameSuffixes(suffixesBuilder.build());
        }
Ejemplo n.º 10
0
        @Override
        public void apply(JsonObject obj, Config.Builder builder) {
          Map<String, CheckLevel> groups = Maps.newHashMap();
          for (Map.Entry<String, JsonElement> entry : obj.entrySet()) {
            String checkLevelString = GsonUtil.stringOrNull(entry.getValue());
            if (checkLevelString == null) {
              continue;
            }
            CheckLevel checkLevel = CheckLevel.valueOf(checkLevelString.toUpperCase());

            groups.put(entry.getKey(), checkLevel);
          }
          builder.setCheckLevelsForDiagnosticGroups(groups);
        }