16
16
17
17
package org .mitre .openid .connect .config ;
18
18
19
+ import com .google .common .base .Splitter ;
20
+ import com .google .gson .JsonElement ;
21
+ import com .google .gson .JsonIOException ;
22
+ import com .google .gson .JsonObject ;
23
+ import com .google .gson .JsonParser ;
24
+ import com .google .gson .JsonSyntaxException ;
25
+ import org .slf4j .Logger ;
26
+ import org .slf4j .LoggerFactory ;
27
+ import org .springframework .beans .factory .annotation .Autowired ;
28
+ import org .springframework .context .support .AbstractMessageSource ;
29
+ import org .springframework .core .io .Resource ;
30
+
19
31
import java .io .File ;
20
32
import java .io .FileNotFoundException ;
21
33
import java .io .IOException ;
28
40
import java .util .Locale ;
29
41
import java .util .Map ;
30
42
31
- import org .slf4j .Logger ;
32
- import org .slf4j .LoggerFactory ;
33
- import org .springframework .beans .factory .annotation .Autowired ;
34
- import org .springframework .context .support .AbstractMessageSource ;
35
- import org .springframework .core .io .Resource ;
36
-
37
- import com .google .common .base .Splitter ;
38
- import com .google .gson .JsonElement ;
39
- import com .google .gson .JsonIOException ;
40
- import com .google .gson .JsonObject ;
41
- import com .google .gson .JsonParser ;
42
- import com .google .gson .JsonSyntaxException ;
43
-
44
43
/**
45
44
* @author jricher
46
45
*/
@@ -54,12 +53,8 @@ public class JsonMessageSource extends AbstractMessageSource {
54
53
55
54
private Map <Locale , List <JsonObject >> languageMaps = new HashMap <>();
56
55
57
- private ConfigurationPropertiesBean config ;
58
-
59
56
@ Autowired
60
- public JsonMessageSource (ConfigurationPropertiesBean config ) {
61
- this .config = config ;
62
- }
57
+ private ConfigurationPropertiesBean config ;
63
58
64
59
@ Override
65
60
protected MessageFormat resolveCode (String code , Locale locale ) {
@@ -86,9 +81,6 @@ protected MessageFormat resolveCode(String code, Locale locale) {
86
81
87
82
/**
88
83
* Get a value from the set of maps, taking the first match in order
89
- * @param code
90
- * @param langs
91
- * @return
92
84
*/
93
85
private String getValue (String code , List <JsonObject > langs ) {
94
86
if (langs == null || langs .isEmpty ()) {
@@ -110,9 +102,6 @@ private String getValue(String code, List<JsonObject> langs) {
110
102
111
103
/**
112
104
* Get a value from a single map
113
- * @param code
114
- * @param lang
115
- * @return
116
105
*/
117
106
private String getValue (String code , JsonObject lang ) {
118
107
@@ -157,7 +146,7 @@ private String getValue(String code, JsonObject lang) {
157
146
* @param locale
158
147
* @return
159
148
*/
160
- List <JsonObject > getLanguageMap (Locale locale ) {
149
+ private List <JsonObject > getLanguageMap (Locale locale ) {
161
150
162
151
if (!languageMaps .containsKey (locale )) {
163
152
try {
0 commit comments