comparison gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java @ 792:9b9bf42b7928

Added and repaired JavaDoc in artifacts package. gnv-artifacts/trunk@874 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 31 Mar 2010 10:52:34 +0000
parents c4156275c1e1
children feae2f9d6c6f
comparison
equal deleted inserted replaced
791:23877dd69444 792:9b9bf42b7928
1 package de.intevation.gnv.artifacts.ressource; 1 package de.intevation.gnv.artifacts.ressource;
2 2
3 import de.intevation.artifacts.PreferredLocale; 3 import de.intevation.artifacts.PreferredLocale;
4 4
5 import java.io.BufferedReader; 5 import java.io.BufferedReader;
6 import java.io.File;
7 import java.io.FileNotFoundException; 6 import java.io.FileNotFoundException;
8 import java.io.IOException; 7 import java.io.IOException;
9 import java.io.InputStream; 8 import java.io.InputStream;
10 import java.io.InputStreamReader; 9 import java.io.InputStreamReader;
11 10
129 128
130 129
131 /** 130 /**
132 * Deliveres the translated Value for an Key to an given Language 131 * Deliveres the translated Value for an Key to an given Language
133 * 132 *
134 * @param locale 133 * @param preferredLocales
135 * The choosen locale 134 * @param key the key
136 * @param key 135 * @param defaultValue the Value that should be returned.
137 * the key
138 * @param defaultValue
139 * the Value that should be returned.
140 * @return the translated Value 136 * @return the translated Value
141 */ 137 */
142 public String getRessource(PreferredLocale[] preferredLocales, String key, 138 public String getRessource(PreferredLocale[] preferredLocales, String key,
143 String defaultValue) { 139 String defaultValue) {
144 if (key == null || preferredLocales.length == 0) { 140 if (key == null || preferredLocales.length == 0) {
147 143
148 return getRessource(preferredLocales[0].getLocale(), key, defaultValue); 144 return getRessource(preferredLocales[0].getLocale(), key, defaultValue);
149 } 145 }
150 146
151 147
148 /**
149 * Deliveres the language specific value for the given <code>key</code>
150 *
151 * @param locale
152 * @param key
153 * @param defaultVal
154 * @return language specific string.
155 */
152 public String getRessource(Locale locale, String key, String defaultVal) { 156 public String getRessource(Locale locale, String key, String defaultVal) {
153 if (key == null || locale == null) 157 if (key == null || locale == null)
154 return defaultVal; 158 return defaultVal;
155 159
156 try { 160 try {
165 log.warn("No resource bundle: " + locale.toString(), mre); 169 log.warn("No resource bundle: " + locale.toString(), mre);
166 return defaultVal; 170 return defaultVal;
167 } 171 }
168 } 172 }
169 } 173 }
174 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org