Search in sources :

Example 26 with InitBinder

use of org.springframework.web.bind.annotation.InitBinder in project portal by ixinportal.

the class RecordHanderController method initBinder.

@InitBinder
public void initBinder(WebDataBinder binder) throws Exception {
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    CustomDateEditor dateEditor = new CustomDateEditor(df, true);
    binder.registerCustomEditor(Date.class, dateEditor);
}
Also used : CustomDateEditor(org.springframework.beans.propertyeditors.CustomDateEditor) SimpleDateFormat(java.text.SimpleDateFormat) DateFormat(java.text.DateFormat) SimpleDateFormat(java.text.SimpleDateFormat) InitBinder(org.springframework.web.bind.annotation.InitBinder)

Example 27 with InitBinder

use of org.springframework.web.bind.annotation.InitBinder in project portal by ixinportal.

the class AbstractController method initBinder.

@InitBinder
public void initBinder(WebDataBinder binder) throws Exception {
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    CustomDateEditor dateEditor = new CustomDateEditor(df, true);
    binder.registerCustomEditor(Date.class, dateEditor);
}
Also used : CustomDateEditor(org.springframework.beans.propertyeditors.CustomDateEditor) SimpleDateFormat(java.text.SimpleDateFormat) DateFormat(java.text.DateFormat) SimpleDateFormat(java.text.SimpleDateFormat) InitBinder(org.springframework.web.bind.annotation.InitBinder)

Example 28 with InitBinder

use of org.springframework.web.bind.annotation.InitBinder in project portal by ixinportal.

the class ActivityCollectService method initBinder.

@RequestMapping(value = "/amaccept.html", produces = "text/html")
@InitBinder
public void initBinder(WebDataBinder binder) throws Exception {
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    CustomDateEditor dateEditor = new CustomDateEditor(df, true);
    binder.registerCustomEditor(Date.class, dateEditor);
}
Also used : CustomDateEditor(org.springframework.beans.propertyeditors.CustomDateEditor) SimpleDateFormat(java.text.SimpleDateFormat) DateFormat(java.text.DateFormat) SimpleDateFormat(java.text.SimpleDateFormat) InitBinder(org.springframework.web.bind.annotation.InitBinder) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 29 with InitBinder

use of org.springframework.web.bind.annotation.InitBinder in project Gemma by PavlidisLab.

the class GeneralSearchControllerImpl method initBinder.

@Override
@InitBinder
protected void initBinder(WebDataBinder binder) {
    super.initBinder(binder);
    binder.registerCustomEditor(Taxon.class, new TaxonPropertyEditor(this.taxonService));
}
Also used : TaxonPropertyEditor(ubic.gemma.web.propertyeditor.TaxonPropertyEditor) InitBinder(org.springframework.web.bind.annotation.InitBinder)

Example 30 with InitBinder

use of org.springframework.web.bind.annotation.InitBinder in project components by Talend.

the class ControllersConfiguration method initBinder.

/**
 * Initialise Web binders to be able to use {@link PropertyTrigger} in camel case in {@link PathVariable}.
 */
@InitBinder
protected void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(PropertyTrigger.class, new PropertyEditorSupport() {

        @Override
        public void setAsText(String text) throws IllegalArgumentException {
            String upperUnderscoreCased = CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.UPPER_UNDERSCORE).convert(text);
            PropertyTrigger propertyTrigger = PropertyTrigger.valueOf(upperUnderscoreCased);
            setValue(propertyTrigger);
        }
    });
    binder.registerCustomEditor(DefinitionType.class, new DefinitionTypeConverter());
    binder.registerCustomEditor(ConnectorTypology.class, new ConnectorTypologyConverter());
}
Also used : DefinitionTypeConverter(org.talend.components.service.rest.DefinitionTypeConverter) ConnectorTypologyConverter(org.talend.components.service.rest.dto.ConnectorTypologyConverter) PropertyTrigger(org.talend.daikon.serialize.jsonschema.PropertyTrigger) PropertyEditorSupport(java.beans.PropertyEditorSupport) InitBinder(org.springframework.web.bind.annotation.InitBinder)

Aggregations

InitBinder (org.springframework.web.bind.annotation.InitBinder)35 SimpleDateFormat (java.text.SimpleDateFormat)13 CustomDateEditor (org.springframework.beans.propertyeditors.CustomDateEditor)13 ByteArrayMultipartFileEditor (org.springframework.web.multipart.support.ByteArrayMultipartFileEditor)9 DateFormat (java.text.DateFormat)6 StringTrimmerEditor (org.springframework.beans.propertyeditors.StringTrimmerEditor)3 GenericConversionService (org.springframework.core.convert.support.GenericConversionService)3 PropertyEditorSupport (java.beans.PropertyEditorSupport)2 DateTimeFormatter (org.joda.time.format.DateTimeFormatter)2 DateTimeFormatterBuilder (org.joda.time.format.DateTimeFormatterBuilder)2 DateConvertEditor (com.cdeledu.core.interceptors.DateConvertEditor)1 TodoPriorityPropertyEditor (com.in28minutes.springmvc.web.util.TodoPriorityPropertyEditor)1 DateTimePropertyEditorSupport (hry.core.util.springmvcPropertyeditor.DateTimePropertyEditorSupport)1 StringPropertyEditorSupport (hry.core.util.springmvcPropertyeditor.StringPropertyEditorSupport)1 NumberFormat (java.text.NumberFormat)1 NonNullBooleanEditor (org.broadleafcommerce.openadmin.web.editor.NonNullBooleanEditor)1 CustomNumberEditor (org.springframework.beans.propertyeditors.CustomNumberEditor)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 DefinitionTypeConverter (org.talend.components.service.rest.DefinitionTypeConverter)1 ConnectorTypologyConverter (org.talend.components.service.rest.dto.ConnectorTypologyConverter)1