Package org.springframework.format.support

# Class FormatterPropertyEditorAdapter

java.lang.Object
java.beans.PropertyEditorSupport
org.springframework.format.support.FormatterPropertyEditorAdapter

All Implemented Interfaces:
  `PropertyEditor`

public class FormatterPropertyEditorAdapter extends PropertyEditorSupport
Adapter that bridges between `Formatter` and `PropertyEditor`.

Since:
  4.2
Author:
  Juergen Hoeller

## Constructor Summary

Constructors
Constructor
Description
`FormatterPropertyEditorAdapter(Formatter<?> formatter)`
Create a new `FormatterPropertyEditorAdapter` for the given `Formatter`.

## Method Summary

Modifier and Type
Method
Description
`String`
`getAsText()`
`Class<?>`
`getFieldType()`
Determine the `Formatter`-declared field type.
`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

### FormatterPropertyEditorAdapter

public FormatterPropertyEditorAdapter(Formatter<?> formatter)
Create a new `FormatterPropertyEditorAdapter` for the given `Formatter`.

Parameters:
  `formatter` - the `Formatter` to wrap

## Method Details

### getFieldType

public Class<?> getFieldType()
Determine the `Formatter`-declared field type.

Returns:
  the field type declared in the wrapped `Formatter` implementation (never `null`)
Throws:
  `IllegalArgumentException` - if the `Formatter`-declared field type cannot be inferred

### setAsText

public void setAsText(String text) throws IllegalArgumentException

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

### getAsText

public String getAsText()

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