当前位置: 首页>>代码示例>>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;未经允许,请勿转载。