Package org.springframework.beans.support

# 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 given `PropertyEditorRegistry` (typically a `BeanWrapper` used for bean creation within an `org.springframework.context.ApplicationContext`) with resource editors. Used by `org.springframework.context.support.AbstractApplicationContext`.

Since:
  2.0
Author:
  Juergen Hoeller, Chris Beams

## Constructor Summary

Constructors
Constructor
Description
`ResourceEditorRegistrar(org.springframework.core.io.ResourceLoader resourceLoader, org.springframework.core.env.PropertyResolver propertyResolver)`
Create a new ResourceEditorRegistrar for the given `ResourceLoader` and `PropertyResolver`.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`overridesDefaultEditors()`
Indicate the use of `PropertyEditorRegistrySupport.overrideDefaultEditor(java.lang.Class<?>, java.beans.PropertyEditor)` above.
`void`
`registerCustomEditors(PropertyEditorRegistry registry)`
Populate the given `registry` with the following resource editors: ResourceEditor, InputStreamEditor, InputSourceEditor, FileEditor, URLEditor, URIEditor, ClassEditor, ClassArrayEditor.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ResourceEditorRegistrar

public ResourceEditorRegistrar(org.springframework.core.io.ResourceLoader resourceLoader, org.springframework.core.env.PropertyResolver propertyResolver)
Create a new ResourceEditorRegistrar for the given `ResourceLoader` and `PropertyResolver`.

Parameters:
  `resourceLoader` - the ResourceLoader (or ResourcePatternResolver) to create editors for (usually an ApplicationContext)
  `propertyResolver` - the PropertyResolver (usually an Environment)
See Also:
  - `Environment`
  - `ResourcePatternResolver`
  - `org.springframework.context.ApplicationContext`

## Method Details

### registerCustomEditors

public void registerCustomEditors(PropertyEditorRegistry registry)
Populate the given `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.

Specified by:
  `registerCustomEditors` in interface `PropertyEditorRegistrar`
Parameters:
  `registry` - the `PropertyEditorRegistry` to register the custom `PropertyEditors` with
See Also:
  - `ResourceEditor`
  - `InputStreamEditor`
  - `InputSourceEditor`
  - `FileEditor`
  - `URLEditor`
  - `URIEditor`
  - `ClassEditor`
  - `ClassArrayEditor`
  - `ResourceArrayPropertyEditor`

### overridesDefaultEditors

public boolean overridesDefaultEditors()
Indicate the use of `PropertyEditorRegistrySupport.overrideDefaultEditor(java.lang.Class<?>, java.beans.PropertyEditor)` above.

Specified by:
  `overridesDefaultEditors` in interface `PropertyEditorRegistrar`
See Also:
  - `PropertyEditorRegistry.registerCustomEditor(java.lang.Class<?>, java.beans.PropertyEditor)`
  - `PropertyEditorRegistrySupport.overrideDefaultEditor(java.lang.Class<?>, java.beans.PropertyEditor)`
  - `PropertyEditorRegistrySupport.setDefaultEditorRegistrar(org.springframework.beans.PropertyEditorRegistrar)`