|
|
@ -40,9 +40,8 @@ import java.util.regex.Pattern; |
|
|
|
* parameter parse utils |
|
|
|
* parameter parse utils |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class ParameterUtils { |
|
|
|
public class ParameterUtils { |
|
|
|
private static final String DATE_PARSE_PATTERN = "\\$\\[([^\\$\\]]+)]"; |
|
|
|
private static final Pattern DATE_PARSE_PATTERN = Pattern.compile("\\$\\[([^\\$\\]]+)]"); |
|
|
|
|
|
|
|
private static final Pattern DATE_START_PATTERN = Pattern.compile("^[0-9]"); |
|
|
|
private static final String DATE_START_PATTERN = "^[0-9]"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ParameterUtils() { |
|
|
|
private ParameterUtils() { |
|
|
|
throw new UnsupportedOperationException("Construct ParameterUtils"); |
|
|
|
throw new UnsupportedOperationException("Construct ParameterUtils"); |
|
|
@ -165,15 +164,15 @@ public class ParameterUtils { |
|
|
|
if (templateStr == null) { |
|
|
|
if (templateStr == null) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
Pattern pattern = Pattern.compile(DATE_PARSE_PATTERN); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuffer newValue = new StringBuffer(templateStr.length()); |
|
|
|
StringBuffer newValue = new StringBuffer(templateStr.length()); |
|
|
|
|
|
|
|
|
|
|
|
Matcher matcher = pattern.matcher(templateStr); |
|
|
|
Matcher matcher = DATE_PARSE_PATTERN.matcher(templateStr); |
|
|
|
|
|
|
|
|
|
|
|
while (matcher.find()) { |
|
|
|
while (matcher.find()) { |
|
|
|
String key = matcher.group(1); |
|
|
|
String key = matcher.group(1); |
|
|
|
if (Pattern.matches(DATE_START_PATTERN, key)) { |
|
|
|
if (DATE_START_PATTERN.matcher(key).matches()) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
String value = TimePlaceholderUtils.getPlaceHolderTime(key, date); |
|
|
|
String value = TimePlaceholderUtils.getPlaceHolderTime(key, date); |
|
|
|