Package org.springframework.beans.propertyeditors

# Class ReaderEditor

java.lang.Object
java.beans.PropertyEditorSupport
org.springframework.beans.propertyeditors.ReaderEditor

All Implemented Interfaces:
  `PropertyEditor`

public class ReaderEditor extends PropertyEditorSupport
One-way PropertyEditor which can convert from a text String to a `java.io.Reader`, interpreting the given String as a Spring resource location (for example, a URL String).

Supports Spring-style URL notation: any fully qualified standard URL ("file:", "http:", etc.) and Spring's special "classpath:" pseudo-URL.

Note that such readers usually do not get closed by Spring itself!

Since:
  4.2
Author:
  Juergen Hoeller
See Also:
  - `Reader`
  - `ResourceEditor`
  - `ResourceLoader`
  - `InputStreamEditor`

## Constructor Summary

Constructors
Constructor
Description
`ReaderEditor()`
Create a new ReaderEditor, using the default ResourceEditor underneath.
`ReaderEditor(org.springframework.core.io.ResourceEditor resourceEditor)`
Create a new ReaderEditor, using the given ResourceEditor underneath.

## Method Summary

Modifier and Type
Method
Description
`String`
`getAsText()`
This implementation returns `null` to indicate that there is no appropriate text representation.
`void`
`setAsText(String text)`

### Methods inherited from class java.beans.PropertyEditorSupport

`addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor`

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

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

## Constructor Details

### ReaderEditor

public ReaderEditor()
Create a new ReaderEditor, using the default ResourceEditor underneath.

### ReaderEditor

public ReaderEditor(org.springframework.core.io.ResourceEditor resourceEditor)
Create a new ReaderEditor, using the given ResourceEditor underneath.

Parameters:
  `resourceEditor` - the ResourceEditor to use

## Method Details

### setAsText

public void setAsText(String text) throws IllegalArgumentException

Specified by:
  `setAsText` in interface `PropertyEditor`
Overrides:
  `setAsText` in class `PropertyEditorSupport`
Throws:
  `IllegalArgumentException`

### getAsText

@Nullable public String getAsText()
This implementation returns `null` to indicate that there is no appropriate text representation.

Specified by:
  `getAsText` in interface `PropertyEditor`
Overrides:
  `getAsText` in class `PropertyEditorSupport`