本文整理汇总了Java中org.springframework.binding.convert.converters.StringToDate类的典型用法代码示例。如果您正苦于以下问题:Java StringToDate类的具体用法?Java StringToDate怎么用?Java StringToDate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StringToDate类属于org.springframework.binding.convert.converters包,在下文中一共展示了StringToDate类的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());
}