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,
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
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,
ApplicationContextpublic 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 PropertyEditorRegistrarregistry - the PropertyEditorRegistry to register the
custom PropertyEditors withResourceEditor,
InputStreamEditor,
InputSourceEditor,
FileEditor,
URLEditor,
URIEditor,
ClassEditor,
ClassArrayEditor,
ResourceArrayPropertyEditorprivate void doRegisterEditor(PropertyEditorRegistry registry, java.lang.Class<?> requiredType, java.beans.PropertyEditor editor)