예제 #1
0
  public static void resolveDeferredValues(Object[] values, Map<String, Object> globals)
      throws Exception {
    // log.info("resolving: " + Arrays.toString(values));
    // log.info("globals=" + globals.toString());

    for (int vx = 0; vx < values.length; vx++) {
      String strVal = values[vx].toString().trim();
      // log.info("strval=" + strVal);
      if (strVal.endsWith("}") && ((strVal.startsWith("{") || strVal.startsWith("${")))) {
        values[vx] = FormatSetReader.resolveValue(strVal.replaceAll("\\$|\\{|\\}", ""), globals);
        // log.info(String.format("resolved %s => %s", strVal, values[vx].toString()));
      }
    }
    // log.info("resolved: " + Arrays.toString(values));
  }
예제 #2
0
 public static Object resolveValue(String genSpec, Map<String, Object> globals) throws Exception {
   return FormatSetReader.resolveValue(FormatSetReader.parseGenspec(genSpec, 0)[0], globals);
 }