Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (C) 2018 Sun.Hao
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package lodsve.core.utils;
import org.apache.commons.lang.exception.NestableRuntimeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 处理字符串中的占位符.
*
* @author sunhao([email protected])
* @version V1.0, 14-9-3 下午10:37
*/
public class PropertyPlaceholderHelper {
private static final Logger logger = LoggerFactory.getLogger(PropertyPlaceholderHelper.class);
/**
* 占位符前缀
*/
private static final String PLACEHOLDER_PREFIX = "${";
/**
* 占位符后缀
*/
private static final String PLACEHOLDER_SUFFIX = "}";
/**
* 左括号
*/
private final static String LEFT_BRACE = "{";
/**
* 右括号
*/
private final static String RIGTH_BRACE = "}";
/**
* 私有化构造器,外部不可以实例化
*/
private PropertyPlaceholderHelper() {
}
/**
* 替换text中的占位符
* eg:
* 1.text值为:
* ${hi},我是${user.name},英文名是${user.eglish.name}!