com.iqiny.silly.spring.spel.SillySpelPropertyHandle Maven / Gradle / Ivy
/*
* Copyright iqiny.com
*
* https://gitee.com/iqiny/silly
*
* project name:silly-spring
* project description:top silly project pom.xml file
*/
package com.iqiny.silly.spring.spel;
import com.iqiny.silly.common.SillyConstant;
import com.iqiny.silly.common.exception.SillyException;
import com.iqiny.silly.common.util.SillyAssert;
import com.iqiny.silly.common.util.StringUtils;
import com.iqiny.silly.core.base.SillyContext;
import com.iqiny.silly.core.config.property.SillyPropertyHandle;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* 集成 SPEL 表达式配置
*/
public class SillySpelPropertyHandle implements SillyPropertyHandle {
public static final String EL_START = "${" ;
public static final String EL_END = "}" ;
private StandardEvaluationContext context;
private SillyContext sillyContext;
private Map values;
private Map root;
private Map nodeRoot;
public StandardEvaluationContext getContext() {
if (context == null) {
HashMap