1 31 32 package org.opencms.main; 33 34 import org.opencms.i18n.CmsMessageContainer; 35 36 import java.util.Locale ; 37 38 48 public class CmsRuntimeException extends RuntimeException implements I_CmsThrowable { 49 50 51 private static final long serialVersionUID = -7855345575622173787L; 52 53 54 protected CmsMessageContainer m_message; 55 56 61 public CmsRuntimeException(CmsMessageContainer message) { 62 63 super(message.getKey()); 64 m_message = message; 65 } 66 67 73 public CmsRuntimeException(CmsMessageContainer message, Throwable cause) { 74 75 super(message.getKey(), cause); 76 m_message = message; 77 } 78 79 87 public CmsRuntimeException createException(CmsMessageContainer container, Throwable cause) { 88 89 return new CmsRuntimeException(container, cause); 90 } 91 92 95 public String getLocalizedMessage() { 96 97 return m_message.key(); 98 } 99 100 103 public String getLocalizedMessage(Locale locale) { 104 105 return m_message.key(locale); 106 } 107 108 111 public String getMessage() { 112 113 return getLocalizedMessage(); 114 } 115 116 119 public CmsMessageContainer getMessageContainer() { 120 121 return m_message; 122 } 123 } 124 | Popular Tags |