Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
TranslationMessage | 35 | 3 | 0% | 3 | 2 |
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.message; | |
21 | ||
22 | import java.util.Collection; | |
23 | import java.util.Locale; | |
24 | ||
25 | import org.xwiki.localization.TranslationBundle; | |
26 | import org.xwiki.rendering.block.Block; | |
27 | import org.xwiki.rendering.block.CompositeBlock; | |
28 | ||
29 | /** | |
30 | * Generate the final translation based or variables informations (parameters, etc.). | |
31 | * | |
32 | * @version $Id: fb3cc2302d665c686397818db6967c0332f95dd5 $ | |
33 | * @since 4.3M2 | |
34 | */ | |
35 | public interface TranslationMessage extends TranslationMessageElement | |
36 | { | |
37 | /** | |
38 | * An empty translation message. | |
39 | */ | |
40 | TranslationMessage EMPTY = new TranslationMessage() | |
41 | { | |
42 | 60 | @Override |
43 | public Block render(Locale locale, Collection<TranslationBundle> bundles, Object... parameters) | |
44 | { | |
45 | 60 | return new CompositeBlock(); |
46 | } | |
47 | ||
48 | 1 | @Override |
49 | public String getRawSource() | |
50 | { | |
51 | 1 | return ""; |
52 | } | |
53 | ||
54 | 0 | @Override |
55 | public String toString() | |
56 | { | |
57 | 0 | return getRawSource(); |
58 | } | |
59 | }; | |
60 | ||
61 | /** | |
62 | * @return the raw source of the translation as it is stored | |
63 | */ | |
64 | String getRawSource(); | |
65 | } |