9eed2cdfa51ada85ce290e1941df03676c1ccfb7
[debian/openrocket] / core / src / net / sf / openrocket / l10n / Translator.java
1 package net.sf.openrocket.l10n;
2
3 import java.util.MissingResourceException;
4
5 /**
6  * An interface for obtaining translations from logical keys.
7  * <p>
8  * Translator implementations must be thread-safe.
9  * 
10  * @author Sampo Niskanen <sampo.niskanen@iki.fi>
11  */
12 public interface Translator {
13         
14         /**
15          * Retrieve a translated string based on a logical key.  This always returns
16          * some string, potentially falling back to the key itself.
17          * 
18          * @param key   the logical string key.
19          * @return              the translated string.
20          * @throws MissingResourceException if the translation corresponding to the key is not found.
21          * @throws NullPointerException if key is null.
22          */
23         public String get(String key);
24         
25 }