Class ResourceEditorRegistrar
- java.lang.Object
- org.springframework.beans.support.ResourceEditorRegistrar
- All Implemented Interfaces:
PropertyEditorRegistrar
public class ResourceEditorRegistrar extends Object implements PropertyEditorRegistrar
PropertyEditorRegistrar implementation that populates a givenPropertyEditorRegistry
(typically aBeanWrapper
used for bean creation within anApplicationContext
) with resource editors. Used byAbstractApplicationContext
.- Since:
- 2.0
- Author:
- Juergen Hoeller, Chris Beams
Constructor Summary
Constructors Constructor Description ResourceEditorRegistrar(ResourceLoader resourceLoader, PropertyResolver propertyResolver)
Create a new ResourceEditorRegistrar for the givenResourceLoader
andPropertyResolver
.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
registerCustomEditors(PropertyEditorRegistry registry)
Populate the givenregistry
with the following resource editors: ResourceEditor, InputStreamEditor, InputSourceEditor, FileEditor, URLEditor, URIEditor, ClassEditor, ClassArrayEditor.
Constructor Detail
ResourceEditorRegistrar
public ResourceEditorRegistrar(ResourceLoader resourceLoader, PropertyResolver propertyResolver)
Create a new ResourceEditorRegistrar for the givenResourceLoader
andPropertyResolver
.- Parameters:
resourceLoader
- the ResourceLoader (or ResourcePatternResolver) to create editors for (usually an ApplicationContext)propertyResolver
- the PropertyResolver (usually an Environment)- See Also:
Environment
,ResourcePatternResolver
,ApplicationContext
Method Detail
registerCustomEditors
public void registerCustomEditors(PropertyEditorRegistry registry)
Populate the givenregistry
with the following resource editors: ResourceEditor, InputStreamEditor, InputSourceEditor, FileEditor, URLEditor, URIEditor, ClassEditor, ClassArrayEditor.If this registrar has been configured with a
ResourcePatternResolver
, a ResourceArrayPropertyEditor will be registered as well.- Specified by:
registerCustomEditors
in interfacePropertyEditorRegistrar
- Parameters:
registry
- thePropertyEditorRegistry
to register the customPropertyEditors
with- See Also:
ResourceEditor
,InputStreamEditor
,InputSourceEditor
,FileEditor
,URLEditor
,URIEditor
,ClassEditor
,ClassArrayEditor
,ResourceArrayPropertyEditor