1package org.bouncycastle.i18n;
2
3import java.util.Locale;
4import java.util.TimeZone;
5
6public class MessageBundle extends TextBundle
7{
8
9    /**
10     * title entry key
11     */
12    public static final String TITLE_ENTRY = "title";
13
14    /**
15     * Constructs a new MessageBundle using <code>resource</code> as the base name for the
16     * RessourceBundle and <code>id</code> as the message bundle id the resource file.
17     * @param resource base name of the resource file
18     * @param id the id of the corresponding bundle in the resource file
19     * @throws NullPointerException if <code>resource</code> or <code>id</code> is <code>null</code>
20     */
21    public MessageBundle(String resource, String id) throws NullPointerException
22    {
23        super(resource, id);
24    }
25
26    /**
27     * Constructs a new MessageBundle using <code>resource</code> as the base name for the
28     * RessourceBundle and <code>id</code> as the message bundle id the resource file.
29     * @param resource base name of the resource file
30     * @param id the id of the corresponding bundle in the resource file
31     * @param arguments an array containing the arguments for the message
32     * @throws NullPointerException if <code>resource</code> or <code>id</code> is <code>null</code>
33     */
34    public MessageBundle(String resource, String id, Object[] arguments) throws NullPointerException
35    {
36        super(resource, id, arguments);
37    }
38
39    /**
40     * Returns the title message in the given locale and timezone.
41     * @param loc the {@link Locale}
42     * @param timezone the {@link TimeZone}
43     * @return the title message.
44     * @throws MissingEntryException if the message is not available
45     */
46    public String getTitle(Locale loc,TimeZone timezone) throws MissingEntryException
47    {
48        return getEntry(TITLE_ENTRY,loc,timezone);
49    }
50
51    /**
52     * Returns the title message in the given locale and the default timezone.
53     * @param loc the {@link Locale}
54     * @return the title message.
55     * @throws MissingEntryException if the message is not available
56     */
57    public String getTitle(Locale loc) throws MissingEntryException
58    {
59        return getEntry(TITLE_ENTRY,loc,TimeZone.getDefault());
60    }
61
62}
63