1 19 20 package org.openharmonise.rm.publishing; 21 22 import java.util.HashMap ; 23 24 32 public class XMLFormErrorCodes { 33 public static final String TAG_ERRORTEXT = "ErrorText" ; 34 public static final String ATTRIB_ERRORCODE = "errorCode" ; 35 public static String OBJECT_NAME_EXISTS = "OBJECT_NAME_EXISTS"; 36 public static String NO_VALUE = "NO_VALUE"; 37 public static String EXCEEDS_SIZE = "EXCEEDS_SIZE"; 38 public static String MANDATORY_FIELD = "MANDATORY_FIELD"; 39 private static XMLFormErrorCodes m_instance; 40 private static HashMap code_map; 41 42 private XMLFormErrorCodes() { 43 code_map = new HashMap (10); 44 code_map.put("OBJECT_NAME_EXISTS", 45 "An object with this name already exists"); 46 code_map.put("NO_VALUE", "A value must be entered"); code_map.put("EXCEEDS_SIZE", "This entry exceeds the maximum size"); 48 code_map.put("MANDATORY_FIELD", "This field is mandatory"); 49 } 50 51 public static synchronized XMLFormErrorCodes getInstance() { 52 if (m_instance == null) { 53 m_instance = new XMLFormErrorCodes(); 54 } 55 56 return m_instance; 57 } 58 59 public String getErrorText(String error_code) { 60 return (String ) code_map.get(error_code); 61 } 62 } | Popular Tags |