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


Java FormatterRegistry.addConverter方法代碼示例

本文整理匯總了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));
}
 
開發者ID:DISID,項目名稱:springlets,代碼行數:11,代碼來源:SpringletsEntityFormatWebConfiguration.java

示例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());
}
 
開發者ID:hpe-idol,項目名稱:find,代碼行數:11,代碼來源:DispatcherServletConfiguration.java

示例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());
}
 
開發者ID:tlin-fei,項目名稱:ds4p,代碼行數:19,代碼來源:ApplicationConversionServiceFactoryBean.java

示例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());
}
 
開發者ID:agwlvssainokuni,項目名稱:sqlapp,代碼行數:9,代碼來源:SecureTypeSqlConverterRegistrar.java

示例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());
}
 
開發者ID:agwlvssainokuni,項目名稱:sqlapp,代碼行數:10,代碼來源:JodaTimeSqlConverterRegistrar.java

示例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);
}
 
開發者ID:qatang,項目名稱:ctm,代碼行數:12,代碼來源:WebConfig.java

示例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());
}
 
開發者ID:molgenis,項目名稱:molgenis,代碼行數:9,代碼來源:RestConfig.java

示例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);
}
 
開發者ID:opensource21,項目名稱:fuwesta,代碼行數:9,代碼來源:WebMvcConfig.java

示例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);
}
 
開發者ID:mustafamym,項目名稱:FeedbackCollectionAndMgmtSystem,代碼行數:9,代碼來源:AppConfig.java

示例11: addFormatters

import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void addFormatters(FormatterRegistry registry) {
	registry.addConverter(new StringToLocalDateTimeConverter());
}
 
開發者ID:Lahne,項目名稱:myfavor,代碼行數:5,代碼來源:WebMvcConfigurer.java

示例12: addFormatters

import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
/**
 * 添加轉換器
 *
 * @param registry
 */
@Override
public void addFormatters ( FormatterRegistry registry ) {
	// 從前台過來的數據轉換成對應類型的轉換器,但是對 @RequestBody 注解的參數無效
	registry.addConverter( new StringToDateConverter() );
}
 
開發者ID:yujunhao8831,項目名稱:spring-boot-start-current,代碼行數:11,代碼來源:SpringConfig.java

示例13: addFormatters

import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void addFormatters(FormatterRegistry registry) {
    registry.addConverter(roleToUserProfileConverter);
}
 
開發者ID:TomirKlos,項目名稱:Webstore,代碼行數:5,代碼來源:AppInitializer.java

示例14: addFormatters

import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void addFormatters(FormatterRegistry registry) {
	registry.addConverter(new StringToUuidConverter());
	super.addFormatters(registry);
}
 
開發者ID:Devskiller,項目名稱:friendly-id,代碼行數:6,代碼來源:FriendlyIdConfiguration.java

示例15: addFormatters

import org.springframework.format.FormatterRegistry; //導入方法依賴的package包/類
@Override
public void addFormatters(FormatterRegistry registry) {
    registry.addConverter(new Base64StringToStringConverter());
}
 
開發者ID:OlivierCroisier,項目名稱:SpringCustomPathVariableBinding,代碼行數:5,代碼來源:WebConfiguration.java


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