1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.localization.internal

File LocalizedTranslationBundle.java

 

Coverage histogram

../../../../img/srcFileCovDistChart4.png
78% of files have more coverage

Code metrics

0
3
3
1
76
28
3
1
1
3
1

Classes

Class Line # Actions
LocalizedTranslationBundle 33 3 0% 3 4
0.3333333433.3%
 

Contributing tests

This file is covered by 8 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.localization.internal;
21   
22    import java.util.Locale;
23   
24    import org.xwiki.localization.TranslationBundle;
25    import org.xwiki.localization.Translation;
26   
27    /**
28    * A translations bundle in a specific {@link Locale}.
29    *
30    * @version $Id: 90f7d70f1119209b655937790344006329e6cc84 $
31    * @since 4.5M1
32    */
 
33    public interface LocalizedTranslationBundle
34    {
35    /**
36    * An empty {@link LocalizedTranslationBundle}.
37    */
38    LocalizedTranslationBundle EMPTY = new LocalizedTranslationBundle()
39    {
 
40  0 toggle @Override
41    public TranslationBundle getBundle()
42    {
43  0 return null;
44    }
45   
 
46  898 toggle @Override
47    public Translation getTranslation(String key)
48    {
49  898 return null;
50    }
51   
 
52  0 toggle @Override
53    public Locale getLocale()
54    {
55  0 return null;
56    }
57    };
58   
59    /**
60    * @return the {@link TranslationBundle} containing this {@link LocalizedTranslationBundle}
61    */
62    TranslationBundle getBundle();
63   
64    /**
65    * @return the {@link Locale} associated to this bundle
66    */
67    Locale getLocale();
68   
69    /**
70    * Get the translation associated to the passed key.
71    *
72    * @param key the translation key
73    * @return the translation
74    */
75    Translation getTranslation(String key);
76    }