All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.xmlform.util.LocaleMap Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
package net.sf.xmlform.util;

import java.util.HashMap;
import java.util.List;
import java.util.Locale;

/**
 * @author Liu Zhikun
 */

public class LocaleMap extends HashMap{
	public T getValue(Locale locale){
		if(size()==0)
    		return null;
    	if(locale==null)
    		locale=Locale.ENGLISH;
    	if(size()==1)
    		return get((Locale)keySet().iterator().next());
    	T res=findI18NText(FormUtils.parseLocaleLevel(locale));
    	if(res!=null){
    		return res;
    	}
    	return findI18NText(FormUtils.parseLocaleLevel(FormUtils.parseLocale(null)));
    }
    private T findI18NText(List list){
    	for(int i=0;i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy