• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LocaleEditor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.springframework.beans.propertyeditors.LocaleEditor的典型用法代码示例。如果您正苦于以下问题:Java LocaleEditor类的具体用法?Java LocaleEditor怎么用?Java LocaleEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LocaleEditor类属于org.springframework.beans.propertyeditors包,在下文中一共展示了LocaleEditor类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: preHandle

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException {
	if (request.getUserPrincipal() != null) {
		String codiIdioma = request.getParameter(this.paramName);
		
		if (codiIdioma != null) {
			personaService.savePrefIdioma(codiIdioma);
			LocaleResolver localeResolver = RequestContextUtils.getLocaleResolver(request);
			if (localeResolver == null)
				throw new IllegalStateException  ("No LocaleResolver found: not in a DispatcherServlet request?");
			LocaleEditor localeEditor = new LocaleEditor();
			localeEditor.setAsText(codiIdioma);
			localeResolver.setLocale(request, response, (Locale)localeEditor.getValue());
		}
	}
	return true;
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:17,代码来源:IdiomaInterceptor.java


示例2: resolveLocale

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
public Locale resolveLocale(HttpServletRequest request) {
	Locale locale = null;
	LocaleEditor localeEditor = new LocaleEditor();
	
	ParellaCodiNom parella = (ParellaCodiNom)WebUtils.getSessionAttribute(request, SESSION_IDIOMA_ACTUAL);
	if (parella != null) {
		localeEditor.setAsText(parella.getCodi());
		locale = (Locale)localeEditor.getValue();
	} else {
		if (request.getUserPrincipal() != null) {
			UsuariPreferencies preferencies = personaService.getUsuariPreferencies();
			if (preferencies != null && preferencies.getIdioma() != null) {
				String idioma = preferencies.getIdioma();
				localeEditor.setAsText(idioma);
				locale = (Locale)localeEditor.getValue();
			}
			if (locale == null || !esIdiomaDisponible(locale)) {
				locale = determinarIdiomaDefecte(request);
			}
		} else {
			locale = determinarIdiomaDefecte(request);
		}
		setLocale(request, locale);
	}
	return locale;
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:27,代码来源:IdiomaResolver.java


示例3: preHandle

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
@Override
public boolean preHandle(HttpServletRequest request,
		HttpServletResponse response, Object handler)
		throws ServletException {
	LocaleResolver localeResolver = RequestContextUtils
			.getLocaleResolver(request);
	if (localeResolver == null) {
		throw new IllegalStateException(
				"No LocaleResolver found: not in a DispatcherServlet request?");
	}
//	CmsSite site = CmsUtils.getSite(request);
	CmsSite site=CmsThreadVariable.getSite();
	String newLocale = site.getLocaleAdmin();
	LocaleEditor localeEditor = new LocaleEditor();
	localeEditor.setAsText(newLocale);
	localeResolver.setLocale(request, response, (Locale) localeEditor
			.getValue());
	// Proceed in any case.
	return true;
}
 
开发者ID:huanzhou,项目名称:jeecms6,代码行数:21,代码来源:AdminLocaleInterceptor.java


示例4: preHandle

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
@Override
public boolean preHandle(HttpServletRequest request,
		HttpServletResponse response, Object handler)
		throws ServletException {
	LocaleResolver localeResolver = RequestContextUtils
			.getLocaleResolver(request);
	if (localeResolver == null) {
		throw new IllegalStateException(
				"No LocaleResolver found: not in a DispatcherServlet request?");
	}
	CmsSite site = CmsUtils.getSite(request);
	String newLocale = site.getLocaleFront();
	LocaleEditor localeEditor = new LocaleEditor();
	localeEditor.setAsText(newLocale);
	localeResolver.setLocale(request, response, (Locale) localeEditor
			.getValue());
	// Proceed in any case.
	return true;
}
 
开发者ID:huanzhou,项目名称:jeecms6,代码行数:20,代码来源:FrontLocaleInterceptor.java


示例5: preHandle

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
@Override
public boolean preHandle(HttpServletRequest request,
		HttpServletResponse response, Object handler)
		throws ServletException {
	LocaleResolver localeResolver = RequestContextUtils
			.getLocaleResolver(request);
	if (localeResolver == null) {
		throw new IllegalStateException(
				"No LocaleResolver found: not in a DispatcherServlet request?");
	}
	CmsSite site = CmsUtils.getSite(request);
	String newLocale = site.getLocaleAdmin();
	LocaleEditor localeEditor = new LocaleEditor();
	localeEditor.setAsText(newLocale);
	localeResolver.setLocale(request, response, (Locale) localeEditor
			.getValue());
	// Proceed in any case.
	return true;
}
 
开发者ID:caipiao,项目名称:Lottery,代码行数:20,代码来源:AdminLocaleInterceptor.java


示例6: setIdiomaDefecte

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
public void setIdiomaDefecte(String idiomaDefecte) {
	if ( idiomaDefecte!=null ) {
		LocaleEditor localeEditor = new LocaleEditor();
		localeEditor.setAsText(idiomaDefecte);
		this.idiomaDefecte = (Locale)localeEditor.getValue();
		
		if ( ! esIdiomaDisponible(this.idiomaDefecte) )
			this.idiomesDisponibles.add(0, this.idiomaDefecte);
	}
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:11,代码来源:IdiomaResolver.java


示例7: setIdiomesDisponibles

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
public void setIdiomesDisponibles(String idiomesDisponibles) {
	if ( idiomesDisponibles!=null && idiomesDisponibles!="" ) {
		this.idiomesDisponibles = new ArrayList<Locale>();
		LocaleEditor localeEditor = new LocaleEditor();

		String idiomes[] = idiomesDisponibles.split(",");
		for ( String idioma: idiomes ) {
			localeEditor.setAsText(idioma);
			this.idiomesDisponibles.add( (Locale)localeEditor.getValue() );
		}
		
		if ( this.idiomaDefecte==null )
			this.idiomaDefecte = this.idiomesDisponibles.get(0);
	}
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:16,代码来源:IdiomaResolver.java


示例8: getLocale

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
private String getLocale(Locale locale) {
	if (locale == null) {
		return "";
	}
	LocaleEditor localeEditor = new LocaleEditor();
	localeEditor.setValue(locale);
	return "_" + localeEditor.getAsText();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:MustacheViewResolver.java


示例9: resolveResource

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
private String resolveResource(String viewName, Locale locale) {
	String l10n = "";
	if (locale != null) {
		LocaleEditor localeEditor = new LocaleEditor();
		localeEditor.setValue(locale);
		l10n = "_" + localeEditor.getAsText();
	}
	return resolveFromLocale(viewName, l10n);
}
 
开发者ID:marlonbernardes,项目名称:spring-boot-jade,代码行数:10,代码来源:JadeViewResolver.java


示例10: createBinder

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
/**
 * Utility method for creating a GrailsDataBinder instance
 *
 * @param target The target object to bind to
 * @param objectName The name of the object
 * @return A GrailsDataBinder instance
 */
public static GrailsDataBinder createBinder(Object target, String objectName) {
	GrailsDataBinder binder = new GrailsDataBinder(target, objectName);
	binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
	binder.registerCustomEditor(String.class, new StringMultipartFileEditor());
	binder.registerCustomEditor(Currency.class, new CurrencyEditor());
	binder.registerCustomEditor(Locale.class, new LocaleEditor());
	binder.registerCustomEditor(TimeZone.class, new TimeZoneEditor());
	binder.registerCustomEditor(URI.class, new UriEditor());

	registerCustomEditors(binder);

	return binder;
}
 
开发者ID:curtiszimmerman,项目名称:AlgoTrader,代码行数:21,代码来源:GrailsDataBinder.java


示例11: setLocale

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
protected void setLocale(HttpServletRequest request, HttpServletResponse response, String newLocale) {
	if (newLocale != null) {
		LocaleResolver localeResolver = RequestContextUtils.getLocaleResolver(request);
		if (localeResolver == null) {
			logger.debug("No LocaleResolver found: not in a DispatcherServlet request?");
			return;
		}
		LocaleEditor localeEditor = new LocaleEditor();
		localeEditor.setAsText(newLocale);
		localeResolver.setLocale(request, response, (Locale) localeEditor.getValue());
	}
}
 
开发者ID:mobilipia,项目名称:Deskera-HRMS,代码行数:13,代码来源:authHandlerController.java


示例12: createDefaultEditors

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
/**
 * Actually register the default editors for this registry instance.
 */
private void createDefaultEditors() {
	this.defaultEditors = new HashMap<Class<?>, PropertyEditor>(64);

	// Simple editors, without parameterization capabilities.
	// The JDK does not contain a default editor for any of these target types.
	this.defaultEditors.put(Charset.class, new CharsetEditor());
	this.defaultEditors.put(Class.class, new ClassEditor());
	this.defaultEditors.put(Class[].class, new ClassArrayEditor());
	this.defaultEditors.put(Currency.class, new CurrencyEditor());
	this.defaultEditors.put(File.class, new FileEditor());
	this.defaultEditors.put(InputStream.class, new InputStreamEditor());
	this.defaultEditors.put(InputSource.class, new InputSourceEditor());
	this.defaultEditors.put(Locale.class, new LocaleEditor());
	this.defaultEditors.put(Pattern.class, new PatternEditor());
	this.defaultEditors.put(Properties.class, new PropertiesEditor());
	this.defaultEditors.put(Resource[].class, new ResourceArrayPropertyEditor());
	this.defaultEditors.put(TimeZone.class, new TimeZoneEditor());
	this.defaultEditors.put(URI.class, new URIEditor());
	this.defaultEditors.put(URL.class, new URLEditor());
	this.defaultEditors.put(UUID.class, new UUIDEditor());
	if (zoneIdClass != null) {
		this.defaultEditors.put(zoneIdClass, new ZoneIdEditor());
	}

	// Default instances of collection editors.
	// Can be overridden by registering custom instances of those as custom editors.
	this.defaultEditors.put(Collection.class, new CustomCollectionEditor(Collection.class));
	this.defaultEditors.put(Set.class, new CustomCollectionEditor(Set.class));
	this.defaultEditors.put(SortedSet.class, new CustomCollectionEditor(SortedSet.class));
	this.defaultEditors.put(List.class, new CustomCollectionEditor(List.class));
	this.defaultEditors.put(SortedMap.class, new CustomMapEditor(SortedMap.class));

	// Default editors for primitive arrays.
	this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor());
	this.defaultEditors.put(char[].class, new CharArrayPropertyEditor());

	// The JDK does not contain a default editor for char!
	this.defaultEditors.put(char.class, new CharacterEditor(false));
	this.defaultEditors.put(Character.class, new CharacterEditor(true));

	// Spring's CustomBooleanEditor accepts more flag values than the JDK's default editor.
	this.defaultEditors.put(boolean.class, new CustomBooleanEditor(false));
	this.defaultEditors.put(Boolean.class, new CustomBooleanEditor(true));

	// The JDK does not contain default editors for number wrapper types!
	// Override JDK primitive number editors with our own CustomNumberEditor.
	this.defaultEditors.put(byte.class, new CustomNumberEditor(Byte.class, false));
	this.defaultEditors.put(Byte.class, new CustomNumberEditor(Byte.class, true));
	this.defaultEditors.put(short.class, new CustomNumberEditor(Short.class, false));
	this.defaultEditors.put(Short.class, new CustomNumberEditor(Short.class, true));
	this.defaultEditors.put(int.class, new CustomNumberEditor(Integer.class, false));
	this.defaultEditors.put(Integer.class, new CustomNumberEditor(Integer.class, true));
	this.defaultEditors.put(long.class, new CustomNumberEditor(Long.class, false));
	this.defaultEditors.put(Long.class, new CustomNumberEditor(Long.class, true));
	this.defaultEditors.put(float.class, new CustomNumberEditor(Float.class, false));
	this.defaultEditors.put(Float.class, new CustomNumberEditor(Float.class, true));
	this.defaultEditors.put(double.class, new CustomNumberEditor(Double.class, false));
	this.defaultEditors.put(Double.class, new CustomNumberEditor(Double.class, true));
	this.defaultEditors.put(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, true));
	this.defaultEditors.put(BigInteger.class, new CustomNumberEditor(BigInteger.class, true));

	// Only register config value editors if explicitly requested.
	if (this.configValueEditorsActive) {
		StringArrayPropertyEditor sae = new StringArrayPropertyEditor();
		this.defaultEditors.put(String[].class, sae);
		this.defaultEditors.put(short[].class, sae);
		this.defaultEditors.put(int[].class, sae);
		this.defaultEditors.put(long[].class, sae);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:74,代码来源:PropertyEditorRegistrySupport.java


示例13: createDefaultEditors

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
/**
 * Actually register the default editors for this registry instance.
 */
private void createDefaultEditors() {
	this.defaultEditors = new HashMap<Class<?>, PropertyEditor>(64);

	// Simple editors, without parameterization capabilities.
	// The JDK does not contain a default editor for any of these target types.
	this.defaultEditors.put(Charset.class, new CharsetEditor());
	this.defaultEditors.put(Class.class, new ClassEditor());
	this.defaultEditors.put(Class[].class, new ClassArrayEditor());
	this.defaultEditors.put(Currency.class, new CurrencyEditor());
	this.defaultEditors.put(File.class, new FileEditor());
	this.defaultEditors.put(InputStream.class, new InputStreamEditor());
	this.defaultEditors.put(InputSource.class, new InputSourceEditor());
	this.defaultEditors.put(Locale.class, new LocaleEditor());
	this.defaultEditors.put(Pattern.class, new PatternEditor());
	this.defaultEditors.put(Properties.class, new PropertiesEditor());
	this.defaultEditors.put(Reader.class, new ReaderEditor());
	this.defaultEditors.put(Resource[].class, new ResourceArrayPropertyEditor());
	this.defaultEditors.put(TimeZone.class, new TimeZoneEditor());
	this.defaultEditors.put(URI.class, new URIEditor());
	this.defaultEditors.put(URL.class, new URLEditor());
	this.defaultEditors.put(UUID.class, new UUIDEditor());
	if (zoneIdClass != null) {
		this.defaultEditors.put(zoneIdClass, new ZoneIdEditor());
	}

	// Default instances of collection editors.
	// Can be overridden by registering custom instances of those as custom editors.
	this.defaultEditors.put(Collection.class, new CustomCollectionEditor(Collection.class));
	this.defaultEditors.put(Set.class, new CustomCollectionEditor(Set.class));
	this.defaultEditors.put(SortedSet.class, new CustomCollectionEditor(SortedSet.class));
	this.defaultEditors.put(List.class, new CustomCollectionEditor(List.class));
	this.defaultEditors.put(SortedMap.class, new CustomMapEditor(SortedMap.class));

	// Default editors for primitive arrays.
	this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor());
	this.defaultEditors.put(char[].class, new CharArrayPropertyEditor());

	// The JDK does not contain a default editor for char!
	this.defaultEditors.put(char.class, new CharacterEditor(false));
	this.defaultEditors.put(Character.class, new CharacterEditor(true));

	// Spring's CustomBooleanEditor accepts more flag values than the JDK's default editor.
	this.defaultEditors.put(boolean.class, new CustomBooleanEditor(false));
	this.defaultEditors.put(Boolean.class, new CustomBooleanEditor(true));

	// The JDK does not contain default editors for number wrapper types!
	// Override JDK primitive number editors with our own CustomNumberEditor.
	this.defaultEditors.put(byte.class, new CustomNumberEditor(Byte.class, false));
	this.defaultEditors.put(Byte.class, new CustomNumberEditor(Byte.class, true));
	this.defaultEditors.put(short.class, new CustomNumberEditor(Short.class, false));
	this.defaultEditors.put(Short.class, new CustomNumberEditor(Short.class, true));
	this.defaultEditors.put(int.class, new CustomNumberEditor(Integer.class, false));
	this.defaultEditors.put(Integer.class, new CustomNumberEditor(Integer.class, true));
	this.defaultEditors.put(long.class, new CustomNumberEditor(Long.class, false));
	this.defaultEditors.put(Long.class, new CustomNumberEditor(Long.class, true));
	this.defaultEditors.put(float.class, new CustomNumberEditor(Float.class, false));
	this.defaultEditors.put(Float.class, new CustomNumberEditor(Float.class, true));
	this.defaultEditors.put(double.class, new CustomNumberEditor(Double.class, false));
	this.defaultEditors.put(Double.class, new CustomNumberEditor(Double.class, true));
	this.defaultEditors.put(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, true));
	this.defaultEditors.put(BigInteger.class, new CustomNumberEditor(BigInteger.class, true));

	// Only register config value editors if explicitly requested.
	if (this.configValueEditorsActive) {
		StringArrayPropertyEditor sae = new StringArrayPropertyEditor();
		this.defaultEditors.put(String[].class, sae);
		this.defaultEditors.put(short[].class, sae);
		this.defaultEditors.put(int[].class, sae);
		this.defaultEditors.put(long[].class, sae);
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:75,代码来源:PropertyEditorRegistrySupport.java


示例14: createDefaultEditors

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
/**
 * Actually register the default editors for this registry instance.
 */
private void createDefaultEditors() {
	this.defaultEditors = new HashMap<Class<?>, PropertyEditor>(64);

	// Simple editors, without parameterization capabilities.
	// The JDK does not contain a default editor for any of these target types.
	this.defaultEditors.put(Charset.class, new CharsetEditor());
	this.defaultEditors.put(Class.class, new ClassEditor());
	this.defaultEditors.put(Class[].class, new ClassArrayEditor());
	this.defaultEditors.put(Currency.class, new CurrencyEditor());
	this.defaultEditors.put(File.class, new FileEditor());
	this.defaultEditors.put(InputStream.class, new InputStreamEditor());
	this.defaultEditors.put(InputSource.class, new InputSourceEditor());
	this.defaultEditors.put(Locale.class, new LocaleEditor());
	this.defaultEditors.put(Pattern.class, new PatternEditor());
	this.defaultEditors.put(Properties.class, new PropertiesEditor());
	this.defaultEditors.put(Resource[].class, new ResourceArrayPropertyEditor());
	this.defaultEditors.put(TimeZone.class, new TimeZoneEditor());
	this.defaultEditors.put(URI.class, new URIEditor());
	this.defaultEditors.put(URL.class, new URLEditor());
	this.defaultEditors.put(UUID.class, new UUIDEditor());

	// Default instances of collection editors.
	// Can be overridden by registering custom instances of those as custom editors.
	this.defaultEditors.put(Collection.class, new CustomCollectionEditor(Collection.class));
	this.defaultEditors.put(Set.class, new CustomCollectionEditor(Set.class));
	this.defaultEditors.put(SortedSet.class, new CustomCollectionEditor(SortedSet.class));
	this.defaultEditors.put(List.class, new CustomCollectionEditor(List.class));
	this.defaultEditors.put(SortedMap.class, new CustomMapEditor(SortedMap.class));

	// Default editors for primitive arrays.
	this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor());
	this.defaultEditors.put(char[].class, new CharArrayPropertyEditor());

	// The JDK does not contain a default editor for char!
	this.defaultEditors.put(char.class, new CharacterEditor(false));
	this.defaultEditors.put(Character.class, new CharacterEditor(true));

	// Spring's CustomBooleanEditor accepts more flag values than the JDK's default editor.
	this.defaultEditors.put(boolean.class, new CustomBooleanEditor(false));
	this.defaultEditors.put(Boolean.class, new CustomBooleanEditor(true));

	// The JDK does not contain default editors for number wrapper types!
	// Override JDK primitive number editors with our own CustomNumberEditor.
	this.defaultEditors.put(byte.class, new CustomNumberEditor(Byte.class, false));
	this.defaultEditors.put(Byte.class, new CustomNumberEditor(Byte.class, true));
	this.defaultEditors.put(short.class, new CustomNumberEditor(Short.class, false));
	this.defaultEditors.put(Short.class, new CustomNumberEditor(Short.class, true));
	this.defaultEditors.put(int.class, new CustomNumberEditor(Integer.class, false));
	this.defaultEditors.put(Integer.class, new CustomNumberEditor(Integer.class, true));
	this.defaultEditors.put(long.class, new CustomNumberEditor(Long.class, false));
	this.defaultEditors.put(Long.class, new CustomNumberEditor(Long.class, true));
	this.defaultEditors.put(float.class, new CustomNumberEditor(Float.class, false));
	this.defaultEditors.put(Float.class, new CustomNumberEditor(Float.class, true));
	this.defaultEditors.put(double.class, new CustomNumberEditor(Double.class, false));
	this.defaultEditors.put(Double.class, new CustomNumberEditor(Double.class, true));
	this.defaultEditors.put(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, true));
	this.defaultEditors.put(BigInteger.class, new CustomNumberEditor(BigInteger.class, true));

	// Only register config value editors if explicitly requested.
	if (this.configValueEditorsActive) {
		StringArrayPropertyEditor sae = new StringArrayPropertyEditor();
		this.defaultEditors.put(String[].class, sae);
		this.defaultEditors.put(short[].class, sae);
		this.defaultEditors.put(int[].class, sae);
		this.defaultEditors.put(long[].class, sae);
	}
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:71,代码来源:PropertyEditorRegistrySupport.java


示例15: setExtendedEditors

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
/**
 * Set the extended <code>PropertyEditor</code> instances, which are only used
 * if explicitly called (i.e. {@link #parseString(Class, String)}.
 */
protected void setExtendedEditors() {
	extEditors.put(InputStream.class, new InputStreamEditor());
	extEditors.put(InputSource.class, new InputSourceEditor());

	extEditors.put(Class[].class, new ClassArrayEditor());

	extEditors.put(Resource[].class, new ResourceArrayPropertyEditor());
	extEditors.put(TimeZone.class, new TimeZoneEditor());

	extEditors.put(byte[].class, new ByteArrayPropertyEditor());
	extEditors.put(char[].class, new CharArrayPropertyEditor());

	extEditors.put(Properties.class, new PropertiesEditor());
	extEditors.put(Set.class, new CustomCollectionEditor(Set.class));
	extEditors
			.put(SortedSet.class, new CustomCollectionEditor(SortedSet.class));
	extEditors.put(List.class, new CustomCollectionEditor(List.class));
	extEditors.put(SortedMap.class, new CustomMapEditor(SortedMap.class));
	extEditors.put(Collection.class, new CustomCollectionEditor(
			Collection.class));

	extEditors.put(char.class, new CharacterEditor(false));
	extEditors.put(Character.class, new CharacterEditor(true));

	extEditors.put(boolean.class, new CustomBooleanEditor(false));
	extEditors.put(byte.class, new CustomNumberEditor(Byte.class, false));
	extEditors.put(short.class, new CustomNumberEditor(Short.class, false));
	extEditors.put(int.class, new CustomNumberEditor(Integer.class, false));
	extEditors.put(long.class, new CustomNumberEditor(Long.class, false));
	extEditors.put(float.class, new CustomNumberEditor(Float.class, false));
	extEditors.put(double.class, new CustomNumberEditor(Double.class, false));

	extEditors.put(Charset.class, new CharsetEditor());
	extEditors.put(Currency.class, new CurrencyEditor());
	extEditors.put(Class.class, new ClassEditor());
	extEditors.put(URL.class, new URLEditor());
	extEditors.put(UUID.class, new UUIDEditor());

	extEditors.put(Pattern.class, new PatternEditor());
	extEditors.put(URI.class, new URIEditor());
	extEditors.put(File.class, new FileEditor());

	extEditors.put(Locale.class, new LocaleEditor());

	extEditors.put(Byte.class, new CustomNumberEditor(Byte.class, true));
	extEditors.put(Short.class, new CustomNumberEditor(Short.class, true));
	extEditors.put(Float.class, new CustomNumberEditor(Float.class, true));
}
 
开发者ID:pmeisen,项目名称:gen-sbconfigurator,代码行数:53,代码来源:StringParser.java


示例16: getTplPath

import org.springframework.beans.propertyeditors.LocaleEditor; //导入依赖的package包/类
/**
 * 获得模板路径。将对模板文件名称进行本地化处理。
 * 
 * @param messageSource
 * @param lang
 *            本地化语言
 * @param solution
 *            方案路径
 * @param dir
 *            模板目录。不本地化处理。
 * @param name
 *            模板名称。本地化处理。
 * @return
 */
public static String getTplPath(MessageSource messageSource, String lang,
		String solution, String dir, String name) {
	LocaleEditor localeEditor = new LocaleEditor();
	localeEditor.setAsText(lang);
	Locale locale = (Locale) localeEditor.getValue();
	return solution + "/" + dir + "/"
			+ messageSource.getMessage(name, null, locale) + TPL_SUFFIX;
}
 
开发者ID:huanzhou,项目名称:jeecms6,代码行数:23,代码来源:FrontUtils.java



注:本文中的org.springframework.beans.propertyeditors.LocaleEditor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TypeConversion类代码示例发布时间:2022-05-21
下一篇:
Java CoprocessorRpcChannel类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap