use of cn.taketoday.beans.PropertyEditorRegistry in project today-infrastructure by TAKETODAY.
the class ArgumentConvertingMethodInvoker method registerCustomEditor.
/**
* Register the given custom property editor for all properties of the given type.
* <p>Typically used in conjunction with the default
* {@link cn.taketoday.beans.SimpleTypeConverter}; will work with any
* TypeConverter that implements the PropertyEditorRegistry interface as well.
*
* @param requiredType type of the property
* @param propertyEditor editor to register
* @see #setTypeConverter
* @see cn.taketoday.beans.PropertyEditorRegistry#registerCustomEditor
*/
public void registerCustomEditor(Class<?> requiredType, PropertyEditor propertyEditor) {
TypeConverter converter = getTypeConverter();
if (!(converter instanceof PropertyEditorRegistry)) {
throw new IllegalStateException("TypeConverter does not implement PropertyEditorRegistry interface: " + converter);
}
((PropertyEditorRegistry) converter).registerCustomEditor(requiredType, propertyEditor);
}
use of cn.taketoday.beans.PropertyEditorRegistry in project today-framework by TAKETODAY.
the class ArgumentConvertingMethodInvoker method registerCustomEditor.
/**
* Register the given custom property editor for all properties of the given type.
* <p>Typically used in conjunction with the default
* {@link cn.taketoday.beans.SimpleTypeConverter}; will work with any
* TypeConverter that implements the PropertyEditorRegistry interface as well.
*
* @param requiredType type of the property
* @param propertyEditor editor to register
* @see #setTypeConverter
* @see cn.taketoday.beans.PropertyEditorRegistry#registerCustomEditor
*/
public void registerCustomEditor(Class<?> requiredType, PropertyEditor propertyEditor) {
TypeConverter converter = getTypeConverter();
if (!(converter instanceof PropertyEditorRegistry)) {
throw new IllegalStateException("TypeConverter does not implement PropertyEditorRegistry interface: " + converter);
}
((PropertyEditorRegistry) converter).registerCustomEditor(requiredType, propertyEditor);
}
Aggregations