Examples of CustomDateEditor


Examples of org.springframework.beans.propertyeditors.CustomDateEditor

    @InitBinder
    protected void initBinder(WebDataBinder binder) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        dateFormat.setLenient(false);
        binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
        binder.registerCustomEditor(String.class, new StringBinder(decipherer));
        binder.registerCustomEditor(List.class, new ListBinder(dao, decipherer));
        binder.registerCustomEditor(Color.class, new ColorBinder());
        binder.registerCustomEditor(Rating.class, new RatingBinder());
        binder.registerCustomEditor(RichText.class, new RichTextBinder());
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomDateEditor

    @SuppressWarnings("unchecked")
    protected Errors doValidation(Class clazz, String path, Object value) throws Exception {
        DomainEntity object = (DomainEntity) ClassUtils.instantiateClass(clazz);
        object.initialize(contextHolder);
        BeanWrapper validatable = new BeanWrapperImpl(object);
        validatable.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), false));
        validatable.setPropertyValue(path, value);
        Errors errors = new BeanPropertyBindingResult(object, "target");
        validator.validate(object, errors);
        return errors;
    }
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomDateEditor

     * of the right type.
     */
    private void configureFactory() {
        SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN, Locale.US);
        formatter.setTimeZone(TimeZone.getTimeZone("America/New_York"));
        CustomDateEditor dateEditor =
            new CustomDateEditor(formatter, true);
        registerCustomEditor(Date.class, dateEditor);
        companyFactory = CompanyFactoryRegistry.getInstance();
        addSingleton(BEAN_FACTORY_NAME, companyFactory);
    }
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomDateEditor

                                    new ByteArrayMultipartFileEditor());
        SimpleDateFormat dateFormat =
            new SimpleDateFormat(getText("date.format", request.getLocale()));
        dateFormat.setLenient(false);
        binder.registerCustomEditor(Date.class, null,
                                    new CustomDateEditor(dateFormat, true));
    }
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomDateEditor

   * Set up a custom property editor for the application's date format.
   */
  protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    dateFormat.setLenient(false);
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
  }
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomDateEditor

     * and another for empty fields.
   */
  protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    dateFormat.setLenient(false);
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
  }
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomDateEditor

 
  @InitBinder
    public void initBinder(WebDataBinder binder) {
        SimpleDateFormat dateFormat = new SimpleDateFormat(LoxiaSupportSettings.getInstance().
            get(LoxiaSupportConstants.DATE_PATTERN));
        binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
        initBinderInternal(binder);
    }
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomDateEditor

     * of the right type.
     */
    private void configureFactory() {
        SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN, Locale.US);
        formatter.setTimeZone(TimeZone.getTimeZone("America/New_York"));
        CustomDateEditor dateEditor =
            new CustomDateEditor(formatter, true);
        registerCustomEditor(Date.class, dateEditor);
        addSingleton(BEAN_FACTORY_NAME, CompanyFactoryRegistry.getInstance());
    }
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomDateEditor

*/
public class CustomWebBindingInitializer implements WebBindingInitializer {

    public void initBinder(final WebDataBinder binder, final WebRequest request) {
        final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
        binder.registerCustomEditor(Short.class, new CustomNumberEditor(Short.class, true));
        binder.registerCustomEditor(Integer.class, new CustomNumberEditor(Integer.class, true));
        binder.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class, true));
        binder.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, true));
        binder.registerCustomEditor(Double.class, new CustomNumberEditor(Double.class, true));
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomDateEditor

   * @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)
   */
  protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    dateFormat.setLenient(false);
    binder.registerCustomEditor(Date.class, null, new CustomDateEditor(dateFormat, false));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.