Example usage for org.springframework.beans PropertyEditorRegistry registerCustomEditor

List of usage examples for org.springframework.beans PropertyEditorRegistry registerCustomEditor

Introduction

In this page you can find the example usage for org.springframework.beans PropertyEditorRegistry registerCustomEditor.

Prototype

void registerCustomEditor(Class<?> requiredType, PropertyEditor propertyEditor);

Source Link

Document

Register the given custom property editor for all properties of the given type.

Usage

From source file:org.uimafit.propertyeditors.PropertyEditorUtil.java

public static void registerUimaFITEditors(PropertyEditorRegistry aRegistry) {
    aRegistry.registerCustomEditor(Locale.class, new LocaleEditor());
    aRegistry.registerCustomEditor(String.class, new GetAsTextStringEditor(aRegistry));
    aRegistry.registerCustomEditor(LinkedList.class, new CustomCollectionEditor(LinkedList.class));
}

From source file:com.helpinput.propertyeditors.PropertyEditorRegister.java

public static void registerProtertyEditor(DefaultListableBeanFactory dlbf,
        Class<? extends PropertyEditor> propertyEditorType, Class<?>... targetType) {
    final Class<?> theTargetType = getTargetType(propertyEditorType, targetType);
    if (theTargetType == null)
        return;/*from w w  w.  ja va  2 s. c om*/

    final PropertyEditor propertyEditor = newProtertyEditor(propertyEditorType, theTargetType);
    if (propertyEditor == null)
        return;

    PropertyEditorRegistrar myPropertyEditorRegistrar = new PropertyEditorRegistrar() {
        public void registerCustomEditors(PropertyEditorRegistry registry) {
            registry.registerCustomEditor(theTargetType, propertyEditor);
        }
    };

    dlbf.addPropertyEditorRegistrar(myPropertyEditorRegistrar);
}

From source file:com.quartzdesk.test.common.spring.CustomEditorRegistrar.java

@Override
public void registerCustomEditors(PropertyEditorRegistry registry) {
    registry.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), false));
}

From source file:org.parancoe.basicWebApp.controllers.BasicPropertyEditorRegistrar.java

public void registerCustomEditors(PropertyEditorRegistry reg) {
    reg.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("dd/MM/yyyy"), true));
}

From source file:org.web4thejob.security.CustomEditorRegistrar.java

@Override
public void registerCustomEditors(PropertyEditorRegistry registry) {
    registry.registerCustomEditor(RequestMatcher.class, new CustomRequestMatcherEditor());
}

From source file:org.web4thejob.context.CustomEditorRegistrar.java

@Override
public void registerCustomEditors(PropertyEditorRegistry registry) {
    registry.registerCustomEditor(SettingEnum.class, new SettingEnumEditor());
}

From source file:org.echocat.jemoni.carbon.spring.CarbonPropertyEditorRegistrar.java

@Override
public void registerCustomEditors(@Nonnull PropertyEditorRegistry registry) {
    registry.registerCustomEditor(Configuration.class, new RulesPropertyEditor());
}

From source file:org.echocat.jomon.spring.types.BasePropertyEditorRegistrar.java

@Override
public void registerCustomEditors(@Nonnull PropertyEditorRegistry registry) {
    registry.registerCustomEditor(InetSocketAddress.class, new InetSocketAddressPropertyEditor());
    registry.registerCustomEditor(LogLevel.class, new LogLevelPropertyEditor());
}

From source file:grails.plugins.crm.core.CustomPropertyEditorRegistrar.java

public void registerCustomEditors(PropertyEditorRegistry registry) {

    registry.registerCustomEditor(java.util.Date.class,
            new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), true));
    registry.registerCustomEditor(java.sql.Date.class,
            new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), true, true));

    // you could register as many custom property editors as are required here...
}

From source file:org.jdal.beans.MessageEditorRegistrar.java

@Override
public void registerCustomEditors(PropertyEditorRegistry registry) {
    registry.registerCustomEditor(String.class, new MessageSourcePropertyEditor(messageSource));

}