public class LogRegxSpelParse extends Object implements ILogParse, org.springframework.beans.factory.BeanFactoryAware, org.springframework.context.ApplicationContextAware
| 构造器和说明 |
|---|
LogRegxSpelParse(IOperatorGetService operatorGetService,
ILogBizEnhance iLogBizEnhance,
IDataHandler dataHandler)
构造函数,初始化必要的服务
|
| 限定符和类型 | 方法和说明 |
|---|---|
LogBizInfo |
afterResolve(LogBizInfo logBizOp,
LogSpelEvaluationContext spelContext,
BizLog bizLog)
后置处理,解析后置表达式并完善日志信息
|
LogBizInfo |
beforeResolve(LogSpelEvaluationContext logSpelContext,
BizLog bizLog)
前置处理,解析前置表达式并构建日志信息
|
LogSpelEvaluationContext |
buildContext(Object target,
Method method,
Object[] args)
构建 SpEL 上下文
|
protected List<String> |
getExpressTemplate(BizLog bizLog)
获取表达式模板列表
|
boolean |
isRecordLog(LogSpelEvaluationContext context,
String conditionSpel)
判断是否记录日志
|
static String |
quoteJson(String jsonStr)
对 JSON 字符串进行引号转义
|
String |
resolveExpression(String template,
LogSpelEvaluationContext logRecordContext)
解析表达式
|
String |
resolveExpression(String template,
LogSpelEvaluationContext logRecordContext,
FuncEval funcEval)
解析表达式,支持自定义函数求值
|
String |
resolveExpression(String template,
LogSpelEvaluationContext logRecordContext,
Map<String,String> funcMap)
解析表达式,支持函数缓存
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
设置应用上下文
|
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
设置 Bean 工厂
|
public LogRegxSpelParse(IOperatorGetService operatorGetService, ILogBizEnhance iLogBizEnhance, IDataHandler dataHandler)
operatorGetService - 操作人获取服务iLogBizEnhance - 日志业务增强服务dataHandler - 数据处理器public boolean isRecordLog(LogSpelEvaluationContext context, String conditionSpel)
isRecordLog 在接口中 ILogParsecontext - SpEL 上下文conditionSpel - 条件表达式public LogSpelEvaluationContext buildContext(Object target, Method method, Object[] args)
buildContext 在接口中 ILogParsetarget - 目标对象method - 方法args - 参数public LogBizInfo beforeResolve(LogSpelEvaluationContext logSpelContext, BizLog bizLog)
beforeResolve 在接口中 ILogParselogSpelContext - SpEL 上下文bizLog - 业务日志注解public LogBizInfo afterResolve(LogBizInfo logBizOp, LogSpelEvaluationContext spelContext, BizLog bizLog)
afterResolve 在接口中 ILogParselogBizOp - 日志业务信息spelContext - SpEL 上下文bizLog - 业务日志注解public String resolveExpression(String template, LogSpelEvaluationContext logRecordContext)
template - 表达式模板logRecordContext - SpEL 上下文public String resolveExpression(String template, LogSpelEvaluationContext logRecordContext, Map<String,String> funcMap)
template - 表达式模板logRecordContext - SpEL 上下文funcMap - 函数缓存public String resolveExpression(String template, LogSpelEvaluationContext logRecordContext, FuncEval funcEval)
template - 表达式模板logRecordContext - SpEL 上下文funcEval - 函数求值器public static String quoteJson(String jsonStr)
jsonStr - JSON 字符串public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory 在接口中 org.springframework.beans.factory.BeanFactoryAwarebeanFactory - Bean 工厂org.springframework.beans.BeansExceptionprotected List<String> getExpressTemplate(BizLog bizLog)
bizLog - 业务日志注解public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext 在接口中 org.springframework.context.ApplicationContextAwareapplicationContext - 应用上下文org.springframework.beans.BeansExceptionCopyright © 2025. All rights reserved.