1 package org.tigris.scarab.util; 2 3 48 49 import org.apache.fulcrum.security.util.TurbineSecurityException; 50 import org.tigris.scarab.tools.ScarabLocalizationTool; 51 import org.tigris.scarab.tools.localization.Localizable; 52 53 59 public class ScarabLocalizedTurbineSecurityException extends TurbineSecurityException implements Localizable 60 { 61 private final Throwable throwable; 62 63 private ScarabLocalizationTool localizer; 65 66 67 73 public ScarabLocalizedTurbineSecurityException(final Throwable t) 74 { 75 super(""); 76 throwable = t; 77 localizer = null; 78 } 79 80 84 public void setLocalizer(final ScarabLocalizationTool theLocalizer) 85 { 86 localizer = theLocalizer; 87 } 88 89 93 public String getMessage() 94 { 95 return throwable.getMessage(); 96 } 97 98 99 106 public String getMessage(final ScarabLocalizationTool l10n) 107 { 108 return l10n.getMessage(throwable); 109 } 110 111 116 public String getLocalizedMessage() 117 { 118 if (localizer != null) 119 { 120 return getMessage(localizer); 121 } 122 else 123 { 124 return super.getLocalizedMessage(); 125 } 126 } 127 128 } 129 | Popular Tags |