本文整理匯總了Java中org.springframework.format.FormatterRegistry.addConverter方法的典型用法代碼示例。如果您正苦於以下問題:Java FormatterRegistry.addConverter方法的具體用法?Java FormatterRegistry.addConverter怎麽用?Java FormatterRegistry.addConverter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.format.FormatterRegistry
的用法示例。
在下文中一共展示了FormatterRegistry.addConverter方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addFormatters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addConverter(new Converter<TestBean, String>() {
@Override
public String convert(TestBean source) {
return "converted";
}
});
}
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:10,代碼來源:WebMvcConfigurationSupportExtensionTests.java
示例2: addFormatters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void addFormatters(FormatterRegistry registry) {
super.addFormatters(registry);
EntityFormatAnnotationFormatterFactory factory = new EntityFormatAnnotationFormatterFactory(
messageSource, applicationContext, (FormattingConversionService) registry);
registry.addFormatterForFieldAnnotation(factory);
registry.addConverter(factory.getToStringConverter());
registry.addConverter(new EnumToMessageConverter(messageSource));
}
示例3: addFormatters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void addFormatters(final FormatterRegistry registry) {
if(converters != null) {
for(final Converter<?, ?> converter : converters) {
registry.addConverter(converter);
}
}
registry.addFormatterForFieldAnnotation(new JodaDateTimeFormatAnnotationFormatterFactory());
}
示例4: installLabelConverters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
/**
* Install label converters.
*
* @param registry the registry
*/
public void installLabelConverters(FormatterRegistry registry) {
registry.addConverter(getClinicalDocumentToStringConverter());
registry.addConverter(getIdToClinicalDocumentConverter());
registry.addConverter(getStringToClinicalDocumentConverter());
registry.addConverter(getConsentToStringConverter());
registry.addConverter(getIdToConsentConverter());
registry.addConverter(getStringToConsentConverter());
registry.addConverter(getPatientToStringConverter());
registry.addConverter(getIdToPatientConverter());
registry.addConverter(getStringToPatientConverter());
}
示例5: registerFormatters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void registerFormatters(FormatterRegistry registry) {
registry.addConverter(new SecureStringConverter());
registry.addConverter(new SecureIntegerConverter());
registry.addConverter(new SecureLongConverter());
registry.addConverter(new SecureBigIntegerConverter());
registry.addConverter(new SecureBigDecimalConverter());
}
示例6: registerFormatters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void registerFormatters(FormatterRegistry registry) {
registry.addConverter(new LocalDateConverter());
registry.addConverter(new SqlDateConverter());
registry.addConverter(new LocalTimeConverter());
registry.addConverter(new SqlTimeConverter());
registry.addConverter(new LocalDateTimeConverter());
registry.addConverter(new SqlTimestampConverter());
}
示例7: addFormatters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void addFormatters(FormatterRegistry registry) {
super.addFormatters(registry);
registry.addConverter(new YesNoStatusConverter());
registry.addConverter(new EnableDisableStatusConverter());
registry.addConverter(new ResourceTypeConverter());
DateFormatter dateFormatter = new DateFormatter("yyyy-MM-dd HH:mm:ss");
dateFormatter.setLenient(true);
registry.addFormatter(dateFormatter);
}
示例8: addFormatters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void addFormatters(FormatterRegistry registry)
{
registry.addConverter(attributeFilterConverter());
registry.addConverter(sortConverter());
registry.addConverter(rsqlQueryConverter());
registry.addConverter(aggregateQueryRsqlConverter());
}
示例9: addFormatters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addFormatterForFieldAnnotation(new NonEmptyStringAnnotationFormatterFactory());
registry.addFormatter(messageSourceDateFormatter());
registry.addConverter(new EnumConverter(configureMessageSource()));
// registry.addConverter(new StringTrimmerConverter(true));
super.addFormatters(registry);
}
示例10: addFormatters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
/**
* Configure Converter to be used.
* In our example, we need a converter to convert string values[Roles] to UserProfiles in newUser.jsp
*/
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addConverter(roleToUserProfileConverter);
}
示例11: addFormatters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addConverter(new StringToLocalDateTimeConverter());
}
示例12: addFormatters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
/**
* 添加轉換器
*
* @param registry
*/
@Override
public void addFormatters ( FormatterRegistry registry ) {
// 從前台過來的數據轉換成對應類型的轉換器,但是對 @RequestBody 注解的參數無效
registry.addConverter( new StringToDateConverter() );
}
示例13: addFormatters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addConverter(roleToUserProfileConverter);
}
示例14: addFormatters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addConverter(new StringToUuidConverter());
super.addFormatters(registry);
}
示例15: addFormatters
import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addConverter(new Base64StringToStringConverter());
}