@Test public void testResolvePlaceholders() { Map<String, String> definedParamMap = SystemParamManager .buildSystemParam(ExecType.DIRECT, new Date(), 200, "job id 001"); String sqls = "${sf.system.bizdate}"; System.out.println(ParamHelper.resolvePlaceholders(sqls, definedParamMap)); sqls = "${sf.system.bizcurdate}"; System.out.println(ParamHelper.resolvePlaceholders(sqls, definedParamMap)); sqls = "${sf.system.cyctime}"; System.out.println(ParamHelper.resolvePlaceholders(sqls, definedParamMap)); sqls = "$[yyyyMMdd]"; System.out.println(ParamHelper.resolvePlaceholders(sqls, definedParamMap)); sqls = "${sf.system.execId}"; System.out.println(ParamHelper.resolvePlaceholders(sqls, definedParamMap)); sqls = "${sf.system.jobId}"; System.out.println(ParamHelper.resolvePlaceholders(sqls, definedParamMap)); }
public static String resolvePlaceholders(String text, Map<String, String> paramMap) { if (StringUtils.isEmpty(text)) { return text; } String cycTimeStr = paramMap.get(SystemParamManager.CYC_TIME); Date cycTime = getCycTime(cycTimeStr); text = PlaceholderUtil.resolvePlaceholders(text, paramMap, true); if (cycTime != null) { text = TimePlaceholderUtil.resolvePlaceholders(text, cycTime, true); } return text; }
ParamHelper { public static String resolvePlaceholders(String text, Map<String, String> paramMap) { if (StringUtils.isEmpty(text)) { return text; } String cycTimeStr = paramMap.get(SystemParamManager.CYC_TIME); Date cycTime = getCycTime(cycTimeStr); text = PlaceholderUtil.resolvePlaceholders(text, paramMap, true); if (cycTime != null) { text = TimePlaceholderUtil.resolvePlaceholders(text, cycTime, true); } return text; } }
ParamHelper { public static String resolvePlaceholders(String text, Map<String, String> paramMap) { if (StringUtils.isEmpty(text)) { return text; } String cycTimeStr = paramMap.get(SystemParamManager.CYC_TIME); Date cycTime = getCycTime(cycTimeStr); text = PlaceholderUtil.resolvePlaceholders(text, paramMap, true); if (cycTime != null) { text = TimePlaceholderUtil.resolvePlaceholders(text, cycTime, true); } return text; }  }
ParamHelper { public static String resolvePlaceholders(String text, Map<String, String> paramMap) { if (StringUtils.isEmpty(text)) { return text; } String cycTimeStr = paramMap.get(SystemParamManager.CYC_TIME); Date cycTime = getCycTime(cycTimeStr); text = PlaceholderUtil.resolvePlaceholders(text, paramMap, true); if (cycTime != null) { text = TimePlaceholderUtil.resolvePlaceholders(text, cycTime, true); } return text; }  static String resolvePlaceholders(String text, Map<String, String> paramMap); }
ParamHelper { public static String resolvePlaceholders(String text, Map<String, String> paramMap) { if (StringUtils.isEmpty(text)) { return text; } String cycTimeStr = paramMap.get(SystemParamManager.CYC_TIME); Date cycTime = getCycTime(cycTimeStr); text = PlaceholderUtil.resolvePlaceholders(text, paramMap, true); if (cycTime != null) { text = TimePlaceholderUtil.resolvePlaceholders(text, cycTime, true); } return text; }  static String resolvePlaceholders(String text, Map<String, String> paramMap);  }