opt:字符串判空用工具类

pull/37/head
da-daken 2 years ago
parent c57f1601a0
commit fc16666200

@ -1,5 +1,6 @@
package com.java3y.austin.support.utils; package com.java3y.austin.support.utils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.expression.MapAccessor; import org.springframework.context.expression.MapAccessor;
import org.springframework.expression.spel.support.StandardEvaluationContext; import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.util.PropertyPlaceholderHelper; import org.springframework.util.PropertyPlaceholderHelper;
@ -54,7 +55,7 @@ public class ContentHolderUtil {
@Override @Override
public String resolvePlaceholder(String placeholderName) { public String resolvePlaceholder(String placeholderName) {
String value = paramMap.get(placeholderName); String value = paramMap.get(placeholderName);
if (null == value) { if (StringUtils.isEmpty(value)) {
String errorStr = MessageFormat.format("template:{0} require param:{1},but not exist! paramMap:{2}", String errorStr = MessageFormat.format("template:{0} require param:{1},but not exist! paramMap:{2}",
template, placeholderName, paramMap.toString()); template, placeholderName, paramMap.toString());
throw new IllegalArgumentException(errorStr); throw new IllegalArgumentException(errorStr);

Loading…
Cancel
Save