本文整理汇总了Java中org.springframework.binding.convert.converters.StringToDate.setPattern方法的典型用法代码示例。如果您正苦于以下问题:Java StringToDate.setPattern方法的具体用法?Java StringToDate.setPattern怎么用?Java StringToDate.setPattern使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.binding.convert.converters.StringToDate
的用法示例。
在下文中一共展示了StringToDate.setPattern方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addDefaultConverters
import org.springframework.binding.convert.converters.StringToDate; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected void addDefaultConverters() {
super.addDefaultConverters();
StringToDate dateConverter = new StringToDate();
dateConverter.setPattern("MM-dd-yyyy");
addConverter("shortDate", dateConverter);
}
示例2: addDefaultConverters
import org.springframework.binding.convert.converters.StringToDate; //导入方法依赖的package包/类
@Override
protected void addDefaultConverters() {
super.addDefaultConverters();
// short date
StringToDate dateConverter = new StringToDate();
dateConverter.setPattern("MM/dd/yyyy");
addConverter("shortDate", dateConverter);
addConverter(new UrlConverter());
}
示例3: afterPropertiesSet
import org.springframework.binding.convert.converters.StringToDate; //导入方法依赖的package包/类
public void afterPropertiesSet() throws Exception {
addConverter(new RegionConverter(this.referenceRepository));
addConverter(new SponsorConverter(this.personRepository));
addConverter(new CountryConverter(this.referenceRepository));
addConverter(new CampusConverter(this.referenceRepository));
addConverter(new TypeConverter(this.referenceRepository));
addConverter(new IdentifierTypeConverter(this.referenceRepository));
final StringToDate dateConverter = new StringToDate();
dateConverter.setPattern(this.defaultDateFormat);
addConverter(dateConverter);
addConverter(new TrimStringToStringConverter());
}
示例4: afterPropertiesSet
import org.springframework.binding.convert.converters.StringToDate; //导入方法依赖的package包/类
public void afterPropertiesSet() throws Exception {
addConverter(new RegionConverter(this.referenceRepository));
addConverter(new SponsorConverter(this.personRepository));
addConverter(new CountryConverter(this.referenceRepository));
addConverter(new CampusConverter(this.referenceRepository));
addConverter(new TypeConverter(this.referenceRepository));
addConverter(new IdentifierTypeConverter(this.referenceRepository));
final StringToDate dateConverter = new StringToDate();
dateConverter.setPattern(this.defaultDateFormat);
addConverter(dateConverter);
addConverter(new TrimStringToStringConverter());
}