Spring Framework CustomNumberEditor - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework CustomNumberEditor class.

This code example shows how to use the following methods:
	 * @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 {
		super.initBinder(request, binder);
		binder.registerCustomEditor(java.lang.Integer.class, new CustomNumberEditor(java.lang.Integer.class, true));
	} 
	 
	/** 
	 * This is called prior to displaying a form for the first time. It tells Spring the 
	 * form/command object to load into the request 
	 *  
	 * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest) 
	 */ 
	protected Object formBackingObject(HttpServletRequest request) throws ServletException {
		 
		//default empty Object 
		List<ProviderAttributeType> providerAttributeTypeList = new Vector<ProviderAttributeType>();
		 
		//only fill the Object is the user has authenticated properly 
5
CodeRank
This code example shows how to use the following methods:
	 * @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 {
		super.initBinder(request, binder);
		binder.registerCustomEditor(java.lang.Integer.class, new CustomNumberEditor(java.lang.Integer.class, true));
	} 
	 
	/** 
	 * This is called prior to displaying a form for the first time. It tells Spring the 
	 * form/command object to load into the request 
	 *  
	 * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest) 
	 */ 
	protected Object formBackingObject(HttpServletRequest request) throws ServletException {
		 
		//default empty Object 
		List<VisitAttributeType> visitAttributeTypeList = new Vector<VisitAttributeType>();
		 
		//only fill the Object is the user has authenticated properly 
5
CodeRank
This code example shows how to use the following methods:
	 * @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 {
		super.initBinder(request, binder);
		binder.registerCustomEditor(java.lang.Integer.class, new CustomNumberEditor(java.lang.Integer.class, true));
	} 
	 
	/** 
	 * This is called prior to displaying a form for the first time. It tells Spring the 
	 * form/command object to load into the request 
	 *  
	 * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest) 
	 */ 
	protected Object formBackingObject(HttpServletRequest request) throws ServletException {
		 
		//default empty Object 
		List<HL7Source> hl7SourceList = new Vector<HL7Source>();
		 
		//only fill the Object is the user has authenticated properly 
5
CodeRank
This code example shows how to use the following methods:
	 * @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 {
		super.initBinder(request, binder);
		binder.registerCustomEditor(java.lang.Integer.class, new CustomNumberEditor(java.lang.Integer.class, true));
	} 
	 
	/** 
	 * This is called prior to displaying a form for the first time. It tells Spring the 
	 * form/command object to load into the request 
	 *  
	 * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest) 
	 */ 
	protected Object formBackingObject(HttpServletRequest request) throws ServletException {
		 
		//default empty Object 
		List<VisitType> visitTypeList = new Vector<VisitType>();
		 
		//only fill the Object is the user has authenticated properly 
5
CodeRank
This code example shows how to use the following methods:
	 * @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 { 
		super.initBinder(request, binder); 
		binder.registerCustomEditor(java.lang.Integer.class, new CustomNumberEditor(java.lang.Integer.class, true)); 
	} 
	 
	/** 
	 * This is called prior to displaying a form for the first time. It tells Spring the 
	 * form/command object to load into the request 
	 *  
	 * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest) 
	 */ 
	protected Object formBackingObject(HttpServletRequest request) throws ServletException { 
		 
		//default empty Object 
		List<EncounterType> encounterTypeList = new Vector<EncounterType>(); 
		 
		//only fill the Object is the user has authenticated properly 
5
CodeRank
This code example shows how to use the following methods:
	 * @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 { 
		super.initBinder(request, binder); 
		binder.registerCustomEditor(java.lang.Integer.class, new CustomNumberEditor(java.lang.Integer.class, true)); 
	} 
	 
	/** 
	 * This is called prior to displaying a form for the first time. It tells Spring the 
	 * form/command object to load into the request 
	 *  
	 * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest) 
	 */ 
	protected Object formBackingObject(HttpServletRequest request) throws ServletException { 
		 
		//default empty Object 
		List<PatientIdentifierType> identifierTypeList = new Vector<PatientIdentifierType>(); 
		 
		//only fill the Object is the user has authenticated properly 
5
CodeRank
This code example shows how to use the following methods:
	 * @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 { 
		super.initBinder(request, binder); 
		binder.registerCustomEditor(java.lang.Integer.class, new CustomNumberEditor(java.lang.Integer.class, true)); 
	} 
	 
	/** 
	 * This is called prior to displaying a form for the first time. It tells Spring the 
	 * form/command object to load into the request 
	 *  
	 * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest) 
	 */ 
	protected Object formBackingObject(HttpServletRequest request) throws ServletException { 
		 
		//default empty Object 
		List<RelationshipType> relationshipTypeList = new Vector<RelationshipType>(); 
		 
		//only fill the Object is the user has authenticated properly 
5
CodeRank
This code example shows how to use the following methods:
 
	@Test(expected = IllegalArgumentException.class)
	public void testSetCustomEditorsWithInvalidTypeName() throws Exception {
 
		DefaultPropertyEditorRegistrar mapper = new DefaultPropertyEditorRegistrar();
		mapper.setCustomEditors(Collections.singletonMap("FOO", new CustomNumberEditor(Long.class, true)));
	} 
 
	@Test
	public void testSetCustomEditorsWithStringTypeName() throws Exception {
 
		DefaultPropertyEditorRegistrar mapper = new DefaultPropertyEditorRegistrar();
		mapper.setCustomEditors(Collections.singletonMap("java.lang.Long", new CustomNumberEditor(Long.class, true)));
		BeanWithIntArray result = new BeanWithIntArray();
		BeanWrapperImpl wrapper = new BeanWrapperImpl(result);
		mapper.registerCustomEditors(wrapper);
		wrapper.setPropertyValues(new MutablePropertyValues(Collections.singletonMap("number", "123")));
		assertEquals(123L, result.number);
 
	} 
5
CodeRank
This code example shows how to use the following methods:
	 *      org.springframework.web.bind.ServletRequestDataBinder) 
	 */ 
	protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { 
		super.initBinder(request, binder); 
		//NumberFormat nf = NumberFormat.getInstance(new Locale("en_US")); 
		binder.registerCustomEditor(java.lang.Integer.class, new CustomNumberEditor(java.lang.Integer.class, true)); 
	} 
	 
	/** 
	 * The onSubmit function receives the form/command object that was modified by the input form 
	 * and saves it to the db 
	 * 
	 * @see org.springframework.web.servlet.mvc.SimpleFormController#onSubmit(javax.servlet.http.HttpServletRequest, 
	 *      javax.servlet.http.HttpServletResponse, java.lang.Object, 
	 *      org.springframework.validation.BindException) 
	 */ 
	protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object obj, 
	        BindException errors) throws Exception { 
		 
		HttpSession httpSession = request.getSession(); 
5
CodeRank
This code example shows how to use the following methods:
	 * @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 { 
		super.initBinder(request, binder); 
		binder.registerCustomEditor(java.lang.Integer.class, new CustomNumberEditor(java.lang.Integer.class, true)); 
	} 
	 
	/** 
	 * The onSubmit function receives the form/command object that was modified by the input form 
	 * and saves it to the db 
	 *  
	 * @see org.springframework.web.servlet.mvc.SimpleFormController#onSubmit(javax.servlet.http.HttpServletRequest, 
	 *      javax.servlet.http.HttpServletResponse, java.lang.Object, 
	 *      org.springframework.validation.BindException) 
	 */ 
	protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object obj, 
	        BindException errors) throws Exception { 
		 
		HttpSession httpSession = request.getSession(); 
5
CodeRank