类 ResourceEditor
java.lang.Object
java.beans.PropertyEditorSupport
cn.taketoday.core.io.ResourceEditor
- 所有已实现的接口:
PropertyEditor
Editor for Resource
descriptors, to automatically convert String locations
e.g. file:C:/myfile.txt or classpath:myfile.txt to
Resource properties instead of using a String location property.
The path may contain ${...} placeholders, to be
resolved as Environment properties:
e.g. ${user.dir}. Unresolvable placeholders are ignored by default.
Delegates to a ResourceLoader to do the heavy lifting,
by default using a DefaultResourceLoader.
- 从以下版本开始:
- 4.0 2022/2/17 17:49
- 作者:
- Juergen Hoeller, Dave Syer, Chris Beams, Harry Yang
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器构造器说明Create a new instance of theResourceEditorclass using aDefaultResourceLoaderandStandardEnvironment.ResourceEditor(ResourceLoader resourceLoader, PropertyResolver propertyResolver) Create a new instance of theResourceEditorclass using the givenResourceLoaderandPropertyResolver.ResourceEditor(ResourceLoader resourceLoader, PropertyResolver propertyResolver, boolean ignoreUnresolvablePlaceholders) Create a new instance of theResourceEditorclass using the givenResourceLoader. -
方法概要
-
字段详细资料
-
resourceLoader
-
propertyResolver
-
ignoreUnresolvablePlaceholders
private final boolean ignoreUnresolvablePlaceholders
-
-
构造器详细资料
-
ResourceEditor
public ResourceEditor()Create a new instance of theResourceEditorclass using aDefaultResourceLoaderandStandardEnvironment. -
ResourceEditor
Create a new instance of theResourceEditorclass using the givenResourceLoaderandPropertyResolver.- 参数:
resourceLoader- theResourceLoaderto usepropertyResolver- thePropertyResolverto use
-
ResourceEditor
public ResourceEditor(ResourceLoader resourceLoader, @Nullable PropertyResolver propertyResolver, boolean ignoreUnresolvablePlaceholders) Create a new instance of theResourceEditorclass using the givenResourceLoader.- 参数:
resourceLoader- theResourceLoaderto usepropertyResolver- thePropertyResolverto useignoreUnresolvablePlaceholders- whether to ignore unresolvable placeholders if no corresponding property could be found in the givenpropertyResolver
-
-
方法详细资料
-
setAsText
- 指定者:
setAsText在接口中PropertyEditor- 覆盖:
setAsText在类中PropertyEditorSupport
-
resolvePath
Resolve the given path, replacing placeholders with corresponding property values from theenvironmentif necessary.- 参数:
path- the original file path- 返回:
- the resolved file path
- 另请参阅:
-
getAsText
- 指定者:
getAsText在接口中PropertyEditor- 覆盖:
getAsText在类中PropertyEditorSupport
-