/webccr/src/com/emis/caesar/emisNLS.java

https://bitbucket.org/sanliou/synccr · Java · 41 lines · 22 code · 10 blank · 9 comment · 3 complexity · dcfb4e34c48021f644291d8238589dac MD5 · raw file

  1. package com.emis.caesar;
  2. import java.util.HashMap;
  3. /*
  4. * There are two resource file relative to NLS
  5. *
  6. * one is classes/caesar_nls.properties
  7. * one is WEB-INF/caesar_nls_user.properties
  8. *
  9. * each locale should load from these two file as well
  10. *
  11. */
  12. public class emisNLS {
  13. static HashMap g_NLSInstance = new HashMap();
  14. public static synchronized emisNLS getLocale(String area) {
  15. area = area.toUpperCase();
  16. emisNLS nls = (emisNLS) g_NLSInstance.get(area);
  17. if( nls == null ) {
  18. nls = new emisNLS(area);
  19. g_NLSInstance.put(area, nls);
  20. }
  21. return nls;
  22. }
  23. HashMap nlsResource = new HashMap();
  24. private emisNLS(String area) {
  25. }
  26. public String getString( String idString ) {
  27. if (idString==null) return "";
  28. idString = idString.toUpperCase();
  29. return (String) nlsResource.get(idString);
  30. }
  31. }