Class SpringResourceLocation
java.lang.Object
org.nutz.resource.impl.ResourceLocation
tech.riemann.nif.nutz.dao.SpringResourceLocation
- All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
public class SpringResourceLocation
extends org.nutz.resource.impl.ResourceLocation
implements org.springframework.context.ApplicationContextAware
Spring资源定位器实现类,用于在Spring环境中扫描和加载资源文件。
该类继承自Nutz框架的ResourceLocation,并实现了Spring的ApplicationContextAware接口,
以便获取Spring应用上下文并利用其资源解析能力。
- Author:
- Kerbores(kerbores@gmail.com)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassSpring资源包装类,将Spring的Resource对象封装为Nutz框架的NutResource对象 -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextSpring应用上下文对象,用于获取资源文件 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()id()获取资源定位器的唯一标识符void扫描指定基础路径下的资源文件,并根据正则表达式过滤符合条件的文件voidsetApplicationContext(@NonNull org.springframework.context.ApplicationContext applicationContext) 设置Spring应用上下文对象Methods inherited from class org.nutz.resource.impl.ResourceLocation
file, getJarPath, jar
-
Field Details
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContextSpring应用上下文对象,用于获取资源文件
-
-
Constructor Details
-
SpringResourceLocation
public SpringResourceLocation()
-
-
Method Details
-
id
获取资源定位器的唯一标识符- Specified by:
idin classorg.nutz.resource.impl.ResourceLocation- Returns:
- 返回字符串"spring"作为该资源定位器的标识符
-
equals
- Overrides:
equalsin classorg.nutz.resource.impl.ResourceLocation
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.nutz.resource.impl.ResourceLocation
-
scan
-
setApplicationContext
public void setApplicationContext(@NonNull org.springframework.context.ApplicationContext applicationContext) 设置Spring应用上下文对象- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Parameters:
applicationContext- Spring应用上下文实例,不能为空
-