public final class PropertyEditorResolver extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PropertyEditorResolver.NoopPropertyEditor |
Modifier and Type | Field and Description |
---|---|
static PropertyEditor |
NOOP_PROPERTY_EDITOR |
Modifier and Type | Method and Description |
---|---|
static void |
clear()
Removes all currently registered value editors.
|
static PropertyEditor |
findEditor(Class<?> type)
Locate a value editor for a given target type.
|
static void |
registerEditor(Class<?> targetType,
Class<? extends PropertyEditor> editorClass)
Registers an editor class to edit values of the given target class.
|
static void |
unregisterEditor(Class<?> targetType)
Unregisters an editor class to edit values of the given target class.
|
public static final PropertyEditor NOOP_PROPERTY_EDITOR
public static void clear()
@Nonnull public static PropertyEditor findEditor(@Nonnull Class<?> type)
If the input type
is an Enum then an instance of EnumPropertyEditor
is returned with the type
set as enumType
.
type
- The Class object for the type to be editedEnumPropertyEditor
public static void unregisterEditor(@Nonnull Class<?> targetType)
targetType
- the class object of the type to be editedpublic static void registerEditor(@Nonnull Class<?> targetType, @Nullable Class<? extends PropertyEditor> editorClass)
null
,
then any existing definition will be removed.
Thus this method can be used to cancel the registration.
The registration is canceled automatically
if either the target or editor class is unloaded.
targetType
- the class object of the type to be editededitorClass
- the class object of the editor class