Top Description Fields Constructors Methods
org.springframework.beans.support

public Class ResourceEditorRegistrar

extends Object
implements PropertyEditorRegistrar
Class Inheritance
All Implemented Interfaces
org.springframework.beans.PropertyEditorRegistrar
Imports
java.beans.PropertyEditor, java.io.File, .InputStream, .Reader, java.net.URI, .URL, java.nio.file.Path, org.xml.sax.InputSource, org.springframework.beans.PropertyEditorRegistrar, .PropertyEditorRegistry, .PropertyEditorRegistrySupport, org.springframework.beans.propertyeditors.ClassArrayEditor, .ClassEditor, .FileEditor, .InputSourceEditor, .InputStreamEditor, .PathEditor, .ReaderEditor, .URIEditor, .URLEditor, org.springframework.core.env.PropertyResolver, org.springframework.core.io.ContextResource, .Resource, .ResourceEditor, .ResourceLoader, .WritableResource, org.springframework.core.io.support.ResourceArrayPropertyEditor, .ResourcePatternResolver

PropertyEditorRegistrar implementation that populates a given org.springframework.beans.PropertyEditorRegistry (typically a org.springframework.beans.BeanWrapper used for bean creation within an org.springframework.context.ApplicationContext) with resource editors. Used by org.springframework.context.support.AbstractApplicationContext.
Authors
Juergen Hoeller, Chris Beams
Since
2.0

Field Summary

Modifier and TypeField and Description
private final PropertyResolver
private final ResourceLoader

Constructor Summary

AccessConstructor and Description
public
ResourceEditorRegistrar(ResourceLoader
the ResourceLoader (or ResourcePatternResolver) to create editors for (usually an ApplicationContext)
resourceLoader
,
PropertyResolver
the PropertyResolver (usually an Environment)
propertyResolver
)

Create a new ResourceEditorRegistrar for the given ResourceLoader and PropertyResolver.

Method Summary

Modifier and TypeMethod and Description
private void
doRegisterEditor(PropertyEditorRegistry registry, Class<?> requiredType, PropertyEditor editor)

Override default editor, if possible (since that's what we really mean to do here); otherwise register as a custom editor.

public void
registerCustomEditors(PropertyEditorRegistry
the PropertyEditorRegistry to register the custom PropertyEditors with
registry
)

Implements org.springframework.beans.PropertyEditorRegistrar.registerCustomEditors.

Populate the given registry with the following resource editors: ResourceEditor, InputStreamEditor, InputSourceEditor, FileEditor, URLEditor, URIEditor, ClassEditor, ClassArrayEditor.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

propertyResolverback to summary
private final PropertyResolver propertyResolver
resourceLoaderback to summary
private final ResourceLoader resourceLoader

Constructor Detail

ResourceEditorRegistrarback to summary
public ResourceEditorRegistrar(ResourceLoader resourceLoader, PropertyResolver propertyResolver)

Create a new ResourceEditorRegistrar for the given ResourceLoader and PropertyResolver.

Parameters
resourceLoader:ResourceLoader

the ResourceLoader (or ResourcePatternResolver) to create editors for (usually an ApplicationContext)

propertyResolver:PropertyResolver

the PropertyResolver (usually an Environment)

See Also
org.springframework.core.env.Environment, org.springframework.core.io.support.ResourcePatternResolver, org.springframework.context.ApplicationContext

Method Detail

doRegisterEditorback to summary
private void doRegisterEditor(PropertyEditorRegistry registry, Class<?> requiredType, PropertyEditor editor)

Override default editor, if possible (since that's what we really mean to do here); otherwise register as a custom editor.

registerCustomEditorsback to summary
public void registerCustomEditors(PropertyEditorRegistry registry)

Implements org.springframework.beans.PropertyEditorRegistrar.registerCustomEditors.

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.

Parameters
registry:PropertyEditorRegistry

Doc from org.springframework.beans.PropertyEditorRegistrar.registerCustomEditors.

the PropertyEditorRegistry to register the custom PropertyEditors with

Annotations
@Override
See Also
org.springframework.core.io.ResourceEditor, org.springframework.beans.propertyeditors.InputStreamEditor, org.springframework.beans.propertyeditors.InputSourceEditor, org.springframework.beans.propertyeditors.FileEditor, org.springframework.beans.propertyeditors.URLEditor, org.springframework.beans.propertyeditors.URIEditor, org.springframework.beans.propertyeditors.ClassEditor, org.springframework.beans.propertyeditors.ClassArrayEditor, org.springframework.core.io.support.ResourceArrayPropertyEditor