/// <summary> /// Used to parse a constant form the constant.xml file that is of the type int /// </summary> /// <param name="constName"></param> /// <returns></returns> public static int getIntConst(String constName) { try { return(Int32.Parse(((String)Constants._con.CONSTANTS[constName]))); } catch (Exception e) { ConstantNotFoundException cnf = new ConstantNotFoundException("Constant not found in XML constants file", e); Logger.getLogger().log(Logger.EXCEPTION_PRIORITY, "Cannot find int constant", cnf); throw cnf; } }
/// <summary> /// Used to parse a constant from the constant.xml file that is of the type string. /// </summary> /// <param name="sConstName">The name of the String constant</param> /// <returns></returns> public static string getSConst(String sConstName) { try { Logger.getLogger().log(Logger.DEBUG_PRIORITY, "is null? " + (Constants._con.CONSTANTS[sConstName] == null)); if (Constants._con.CONSTANTS[sConstName] == null) { throw new ConstantNotFoundException("String lookup returned null"); } return((String)Constants._con.CONSTANTS[sConstName]); } catch (Exception e) { ConstantNotFoundException cnf = new ConstantNotFoundException("Constant not found in XML constants file", e); Logger.getLogger().log(Logger.EXCEPTION_PRIORITY, "Cannot find string constant", cnf); throw cnf; } }