|
|
@ -5,6 +5,7 @@ import org.springframework.util.PropertyPlaceholderHelper;
|
|
|
|
|
|
|
|
|
|
|
|
import java.text.MessageFormat;
|
|
|
|
import java.text.MessageFormat;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @author 3y
|
|
|
|
* @author 3y
|
|
|
@ -43,6 +44,10 @@ public class ContentHolderUtil {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public String resolvePlaceholder(String placeholderName) {
|
|
|
|
public String resolvePlaceholder(String placeholderName) {
|
|
|
|
|
|
|
|
if (Objects.isNull(paramMap)) {
|
|
|
|
|
|
|
|
String errorStr = MessageFormat.format("template:{0} require param:{1},but not exist! paramMap:{2}", template, placeholderName, paramMap);
|
|
|
|
|
|
|
|
throw new IllegalArgumentException(errorStr);
|
|
|
|
|
|
|
|
}
|
|
|
|
String value = paramMap.get(placeholderName);
|
|
|
|
String value = paramMap.get(placeholderName);
|
|
|
|
if (StringUtils.isEmpty(value)) {
|
|
|
|
if (StringUtils.isEmpty(value)) {
|
|
|
|
String errorStr = MessageFormat.format("template:{0} require param:{1},but not exist! paramMap:{2}", template, placeholderName, paramMap);
|
|
|
|
String errorStr = MessageFormat.format("template:{0} require param:{1},but not exist! paramMap:{2}", template, placeholderName, paramMap);
|
|
|
|