當前位置: 首頁>>代碼示例>>Java>>正文


Java CustomDateEditor類代碼示例

本文整理匯總了Java中org.springframework.beans.propertyeditors.CustomDateEditor的典型用法代碼示例。如果您正苦於以下問題:Java CustomDateEditor類的具體用法?Java CustomDateEditor怎麽用?Java CustomDateEditor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CustomDateEditor類屬於org.springframework.beans.propertyeditors包,在下文中一共展示了CustomDateEditor類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initBinder

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.registerCustomEditor(
			Long.class,
			new CustomNumberEditor(Long.class, true));
	binder.registerCustomEditor(
			Double.class,
			new CustomNumberEditor(Double.class, true));
	binder.registerCustomEditor(
			BigDecimal.class,
			new CustomNumberEditor(
					BigDecimal.class,
					new DecimalFormat("#,##0.00"),
					true));
	binder.registerCustomEditor(
			Boolean.class,
			new CustomBooleanEditor(true));
	binder.registerCustomEditor(
			Date.class,
			new CustomDateEditor(new SimpleDateFormat("dd/MM/yyyy"), true));
	binder.registerCustomEditor(
			Object.class,
			new ObjectTypeEditorHelper());
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:25,代碼來源:TascaTramitacioController.java

示例2: initBinder

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.setAutoGrowNestedPaths(false);
	binder.registerCustomEditor(
			Long.class,
			new CustomNumberEditor(Long.class, true));
	binder.registerCustomEditor(
			Double.class,
			new CustomNumberEditor(Double.class, true));
	binder.registerCustomEditor(
			BigDecimal.class,
			new CustomNumberEditor(
					BigDecimal.class,
					new DecimalFormat("#,##0.00"),
					true));
	binder.registerCustomEditor(
			Boolean.class,
			new CustomBooleanEditor(true));
	binder.registerCustomEditor(
			Date.class,
			new CustomDateEditor(new SimpleDateFormat("dd/MM/yyyy"), true));
	binder.registerCustomEditor(
			Object.class,
			new ObjectTypeEditorHelper());
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:26,代碼來源:ExpedientConsultaInformeController.java

示例3: initBinder

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.registerCustomEditor(
			byte[].class,
			new ByteArrayMultipartFileEditor());
	binder.registerCustomEditor(
			Date.class,
			new CustomDateEditor(new SimpleDateFormat("dd/MM/yyyy"), true));
	binder.registerCustomEditor(
			Long.class,
			new CustomNumberEditor(Long.class, true));
	binder.registerCustomEditor(
			Double.class,
			new CustomNumberEditor(Double.class, true));
	binder.registerCustomEditor(
			BigDecimal.class,
			new CustomNumberEditor(
					BigDecimal.class,
					new DecimalFormat("#,##0.00"),
					true));
	binder.registerCustomEditor(
			Boolean.class,
			new CustomBooleanEditor(false));
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:25,代碼來源:ExpedientMassivaController.java

示例4: initBinder

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.registerCustomEditor(
			Long.class,
			new CustomNumberEditor(Long.class, true));
	binder.registerCustomEditor(
			Double.class,
			new CustomNumberEditor(Double.class, true));
	binder.registerCustomEditor(
			BigDecimal.class,
			new CustomNumberEditor(
					BigDecimal.class,
					new DecimalFormat("#,##0.00"),
					true));
	binder.registerCustomEditor(
			Boolean.class,
			new CustomBooleanEditor(false));
	binder.registerCustomEditor(
			Date.class,
			new CustomDateEditor(new SimpleDateFormat("dd/MM/yyyy"), true));
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:22,代碼來源:TascaFormController.java

示例5: transformTagNonExistingValue

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@Test
public void transformTagNonExistingValue() throws JspException {
	// first set up the pagecontext and the bean
	PageContext pc = createPageContext();
	TestBean tb = new TestBean();
	DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
	ServletRequestDataBinder binder = new ServletRequestDataBinder(tb, "tb");
	CustomDateEditor l = new CustomDateEditor(df, true);
	binder.registerCustomEditor(Date.class, l);
	pc.getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "tb", binder.getBindingResult());

	// try with non-existing value
	BindTag bind = new BindTag();
	bind.setPageContext(pc);
	bind.setPath("tb.name");
	bind.doStartTag();

	TransformTag transform = new TransformTag();
	transform.setPageContext(pc);
	transform.setValue(null);
	transform.setParent(bind);
	transform.setVar("theString2");
	transform.doStartTag();

	assertNull(pc.getAttribute("theString2"));
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:27,代碼來源:BindTagTests.java

示例6: initBinder

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@InitBinder
public void initBinder(ServletRequestDataBinder binder) {
    /**
     * 自動轉換日期類型的字段格式
     */
    binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"), true));
    /**
     * 防止XSS攻擊
     */
    binder.registerCustomEditor(String.class, new StringEscapeEditor());
}
 
開發者ID:TomChen001,項目名稱:xmanager,代碼行數:12,代碼來源:BaseController.java

示例7: initBinder

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@InitBinder
public void initBinder(WebDataBinder binder) {
	SimpleDateFormat dateFormat = new SimpleDateFormat(
			TodoListUtils.DATE_FORMAT);
	binder.registerCustomEditor(Date.class, new CustomDateEditor(
			dateFormat, false));
	binder.registerCustomEditor(Priority.class,
			new TodoPriorityPropertyEditor());
}
 
開發者ID:sernty,項目名稱:https-github.com-in28minutes-SpringIn28Minutes,代碼行數:10,代碼來源:TodoController.java

示例8: initBinder

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.registerCustomEditor(
			Date.class,
			new CustomDateEditor(new SimpleDateFormat("dd/MM/yyyy"), true));
	binder.registerCustomEditor(
			Object.class,
			new ObjectTypeEditorHelper());
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:10,代碼來源:ReassignacioUsuarisController.java

示例9: initBinder

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.registerCustomEditor(
			byte[].class,
			new ByteArrayMultipartFileEditor());
	binder.registerCustomEditor(
			Date.class,
			new CustomDateEditor(new SimpleDateFormat("dd/MM/yyyy"), true));
	binder.registerCustomEditor(
			Long.class,
			new CustomNumberEditor(Long.class, true));
	binder.registerCustomEditor(
			Double.class,
			new CustomNumberEditor(Double.class, true));
	binder.registerCustomEditor(
			BigDecimal.class,
			new CustomNumberEditor(
					BigDecimal.class,
					new DecimalFormat("#,##0.00"),
					true));
	binder.registerCustomEditor(
			Boolean.class,
			new CustomBooleanEditor(false));
	binder.registerCustomEditor(
			Object.class,
			new ObjectTypeEditorHelper());
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:28,代碼來源:MassivaExpedientController.java

示例10: initBinder

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    dateFormat.setLenient(false);
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:8,代碼來源:ExpedientTipusController.java

示例11: initBinder

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@InitBinder
	public void initBinder(WebDataBinder binder) {
		binder.registerCustomEditor(
				Long.class,
				new CustomNumberEditor(Long.class, true));
		binder.registerCustomEditor(
				Double.class,
				new CustomNumberEditor(Double.class, true));
		binder.registerCustomEditor(
				BigDecimal.class,
				new CustomNumberEditor(
						BigDecimal.class,
						new DecimalFormat("#,##0.00"),
						true));
		binder.registerCustomEditor(
				Boolean.class,
//				new CustomBooleanEditor(false));
				new CustomBooleanEditor(true));
		binder.registerCustomEditor(
				Date.class,
				new CustomDateEditor(new SimpleDateFormat("dd/MM/yyyy"), true));
//		binder.registerCustomEditor(
//				TerminiDto.class,
//				new TerminiTypeEditorHelper());
		binder.registerCustomEditor(
				Object.class,
				new ObjectTypeEditorHelper());
	}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:29,代碼來源:ExpedientInicioPasFormController.java

示例12: initBinder

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    dateFormat.setLenient(false);
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
	binder.registerCustomEditor(
			Object.class,
			new ObjectTypeEditorHelper());
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:11,代碼來源:TascaLlistatV3Controller.java

示例13: initBinder

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.registerCustomEditor(
			byte[].class,
			new ByteArrayMultipartFileEditor());
	binder.registerCustomEditor(
			Date.class,
			new CustomDateEditor(new SimpleDateFormat("dd/MM/yyyy"), true));
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:10,代碼來源:TascaDocumentsController.java

示例14: initBinder

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.registerCustomEditor(
			boolean.class,
			new CustomBooleanEditor(false));
	binder.registerCustomEditor(
			Date.class,
			new CustomDateEditor(new SimpleDateFormat("dd/MM/yyyy"), true));
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:10,代碼來源:PerfilController.java

示例15: initBinder

import org.springframework.beans.propertyeditors.CustomDateEditor; //導入依賴的package包/類
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.registerCustomEditor(
			boolean.class,
			new CustomBooleanEditor(false));
	binder.registerCustomEditor(
			Date.class,
			new CustomDateEditor(new SimpleDateFormat("dd/MM/yyyy"), true));
	binder.registerCustomEditor(
			Permis.class,
			new PermisTypeEditor());
}
 
開發者ID:GovernIB,項目名稱:helium,代碼行數:13,代碼來源:PermisController.java


注:本文中的org.springframework.beans.propertyeditors.CustomDateEditor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。