public class ResourceEditorRegistrar extends java.lang.Object implements PropertyEditorRegistrar
PropertyEditorRegistry
(typically a BeanWrapper
used for bean
creation within an ApplicationContext
)
with resource editors. Used by
AbstractApplicationContext
.Modifier and Type | Field and Description |
---|---|
private PropertyResolver |
propertyResolver |
private ResourceLoader |
resourceLoader |
Constructor and Description |
---|
ResourceEditorRegistrar(ResourceLoader resourceLoader)
Deprecated.
as of Spring 3.1 in favor of
ResourceEditorRegistrar(ResourceLoader, PropertyResolver) |
ResourceEditorRegistrar(ResourceLoader resourceLoader,
PropertyResolver propertyResolver)
Create a new ResourceEditorRegistrar for the given
ResourceLoader
and PropertyResolver . |
Modifier and Type | Method and Description |
---|---|
private void |
doRegisterEditor(PropertyEditorRegistry registry,
java.lang.Class<?> requiredType,
java.beans.PropertyEditor editor)
Override default editor, if possible (since that's what we really mean to do here);
otherwise register as a custom editor.
|
void |
registerCustomEditors(PropertyEditorRegistry registry)
Populate the given
registry with the following resource editors:
ResourceEditor, InputStreamEditor, InputSourceEditor, FileEditor, URLEditor,
URIEditor, ClassEditor, ClassArrayEditor. |
private final PropertyResolver propertyResolver
private final ResourceLoader resourceLoader
@Deprecated public ResourceEditorRegistrar(ResourceLoader resourceLoader)
ResourceEditorRegistrar(ResourceLoader, PropertyResolver)
ResourceLoader
using a StandardEnvironment
.resourceLoader
- the ResourceLoader (or ResourcePatternResolver)
to create editors for (usually an ApplicationContext)ResourcePatternResolver
,
ApplicationContext
public ResourceEditorRegistrar(ResourceLoader resourceLoader, PropertyResolver propertyResolver)
ResourceLoader
and PropertyResolver
.resourceLoader
- the ResourceLoader (or ResourcePatternResolver)
to create editors for (usually an ApplicationContext)propertyResolver
- the PropertyResolver (usually an Environment)Environment
,
ResourcePatternResolver
,
ApplicationContext
public void registerCustomEditors(PropertyEditorRegistry registry)
registry
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.
registerCustomEditors
in interface PropertyEditorRegistrar
registry
- the PropertyEditorRegistry
to register the
custom PropertyEditors
withResourceEditor
,
InputStreamEditor
,
InputSourceEditor
,
FileEditor
,
URLEditor
,
URIEditor
,
ClassEditor
,
ClassArrayEditor
,
ResourceArrayPropertyEditor
private void doRegisterEditor(PropertyEditorRegistry registry, java.lang.Class<?> requiredType, java.beans.PropertyEditor editor)