~brian-thomason/+junk/bouncycastle

« back to all changes in this revision

Viewing changes to jdk1.2/org/bouncycastle/i18n/MissingEntryException.java

  • Committer: Brian Thomason
  • Date: 2011-12-20 17:20:32 UTC
  • Revision ID: brian.thomason@canonical.com-20111220172032-rdtm13jgdxtksacr
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.bouncycastle.i18n;
 
2
 
 
3
import java.net.URL;
 
4
import java.util.Locale;
 
5
 
 
6
public class MissingEntryException extends RuntimeException 
 
7
{
 
8
 
 
9
    protected final String resource;
 
10
    protected final String key;
 
11
    protected final ClassLoader loader;
 
12
    protected final Locale locale;
 
13
    
 
14
    private String debugMsg;
 
15
 
 
16
    public MissingEntryException(String message, String resource, String key, Locale locale, ClassLoader loader) 
 
17
    {
 
18
        super(message);
 
19
        this.resource = resource;
 
20
        this.key = key;
 
21
        this.locale = locale;
 
22
        this.loader = loader;
 
23
    }
 
24
    
 
25
    public MissingEntryException(String message, Throwable cause, String resource, String key, Locale locale, ClassLoader loader) 
 
26
    {
 
27
        super(message + ": " + cause);
 
28
        this.resource = resource;
 
29
        this.key = key;
 
30
        this.locale = locale;
 
31
        this.loader = loader;
 
32
    }
 
33
 
 
34
    public String getKey()
 
35
    {
 
36
        return key;
 
37
    }
 
38
 
 
39
    public String getResource()
 
40
    {
 
41
        return resource;
 
42
    }
 
43
    
 
44
    public ClassLoader getClassLoader()
 
45
    {
 
46
        return loader;
 
47
    }
 
48
    
 
49
    public Locale getLocale()
 
50
    {
 
51
        return locale;
 
52
    }
 
53
 
 
54
    public String getDebugMsg()
 
55
    {
 
56
        if (debugMsg == null)
 
57
        {
 
58
            debugMsg = "Can not find entry " + key + " in resource file " + resource + " for the locale " + locale + ".";
 
59
        }
 
60
        return debugMsg;
 
61
    }
 
62
 
 
63
}