类 ResourceArrayPropertyEditor
java.lang.Object
java.beans.PropertyEditorSupport
cn.taketoday.core.io.ResourceArrayPropertyEditor
- 所有已实现的接口:
PropertyEditor
Editor for
Resource arrays, to
automatically convert String location patterns
(e.g. "file:C:/my*.txt" or "classpath*:myfile.txt")
to Resource array properties. Can also translate a collection
or array of location patterns into a merged Resource array.
A path may contain ${...} placeholders, to be
resolved as Environment properties:
e.g. ${user.dir}. Unresolvable placeholders are ignored by default.
Delegates to a PatternResourceLoader,
by default using a PathMatchingPatternResourceLoader.
- 从以下版本开始:
- 4.0 2022/2/17 17:50
- 作者:
- Juergen Hoeller, Chris Beams, Harry Yang
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明private final booleanprivate static final Loggerprivate PropertyResolverprivate final PatternResourceLoader -
构造器概要
构造器构造器说明Create a new ResourceArrayPropertyEditor with a defaultPathMatchingPatternResourceLoaderandStandardEnvironment.ResourceArrayPropertyEditor(PatternResourceLoader resourcePatternResolver, PropertyResolver propertyResolver) Create a new ResourceArrayPropertyEditor with the givenPatternResourceLoaderandPropertyResolver(typically anEnvironment).ResourceArrayPropertyEditor(PatternResourceLoader resourcePatternResolver, PropertyResolver propertyResolver, boolean ignoreUnresolvablePlaceholders) Create a new ResourceArrayPropertyEditor with the givenPatternResourceLoaderandPropertyResolver(typically anEnvironment). -
方法概要
修饰符和类型方法说明protected StringresolvePath(String path) Resolve the given path, replacing placeholders with corresponding system property values if necessary.voidTreat the given text as a location pattern and convert it to a Resource array.voidTreat the given value as a collection or array and convert it to a Resource array.
-
字段详细资料
-
logger
-
resourcePatternResolver
-
propertyResolver
-
ignoreUnresolvablePlaceholders
private final boolean ignoreUnresolvablePlaceholders
-
-
构造器详细资料
-
ResourceArrayPropertyEditor
public ResourceArrayPropertyEditor()Create a new ResourceArrayPropertyEditor with a defaultPathMatchingPatternResourceLoaderandStandardEnvironment. -
ResourceArrayPropertyEditor
public ResourceArrayPropertyEditor(PatternResourceLoader resourcePatternResolver, @Nullable PropertyResolver propertyResolver) Create a new ResourceArrayPropertyEditor with the givenPatternResourceLoaderandPropertyResolver(typically anEnvironment).- 参数:
resourcePatternResolver- the ResourcePatternResolver to usepropertyResolver- the PropertyResolver to use
-
ResourceArrayPropertyEditor
public ResourceArrayPropertyEditor(PatternResourceLoader resourcePatternResolver, @Nullable PropertyResolver propertyResolver, boolean ignoreUnresolvablePlaceholders) Create a new ResourceArrayPropertyEditor with the givenPatternResourceLoaderandPropertyResolver(typically anEnvironment).- 参数:
resourcePatternResolver- the ResourcePatternResolver to usepropertyResolver- the PropertyResolver to useignoreUnresolvablePlaceholders- whether to ignore unresolvable placeholders if no corresponding system property could be found
-
-
方法详细资料
-
setAsText
Treat the given text as a location pattern and convert it to a Resource array.- 指定者:
setAsText在接口中PropertyEditor- 覆盖:
setAsText在类中PropertyEditorSupport
-
setValue
Treat the given value as a collection or array and convert it to a Resource array. Considers String elements as location patterns and takes Resource elements as-is.- 指定者:
setValue在接口中PropertyEditor- 覆盖:
setValue在类中PropertyEditorSupport- 抛出:
IllegalArgumentException
-
resolvePath
Resolve the given path, replacing placeholders with corresponding system property values if necessary.- 参数:
path- the original file path- 返回:
- the resolved file path
- 另请参阅:
-