author | aefimov |
Thu, 16 Feb 2017 13:14:39 +0300 | |
changeset 43852 | 93a527059d8a |
parent 38822 | 8cc53e29c1d9 |
permissions | -rw-r--r-- |
12009 | 1 |
/* |
43852
93a527059d8a
8174735: Update JAX-WS RI integration to latest version
aefimov
parents:
38822
diff
changeset
|
2 |
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
12009 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
package com.sun.istack.internal.localization; |
|
27 |
||
38822
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
28 |
import com.sun.istack.internal.localization.LocalizableMessageFactory.ResourceBundleSupplier; |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
29 |
|
16791 | 30 |
import java.util.Arrays; |
38822
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
31 |
import java.util.Locale; |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
32 |
import java.util.ResourceBundle; |
16791 | 33 |
|
43852
93a527059d8a
8174735: Update JAX-WS RI integration to latest version
aefimov
parents:
38822
diff
changeset
|
34 |
|
12009 | 35 |
/** |
36 |
* @author WS Development Team |
|
37 |
*/ |
|
38 |
public final class LocalizableMessage implements Localizable { |
|
39 |
||
40 |
private final String _bundlename; |
|
38822
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
41 |
private final ResourceBundleSupplier _rbSupplier; |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
42 |
|
12009 | 43 |
private final String _key; |
44 |
private final Object[] _args; |
|
45 |
||
43852
93a527059d8a
8174735: Update JAX-WS RI integration to latest version
aefimov
parents:
38822
diff
changeset
|
46 |
@Deprecated |
12009 | 47 |
public LocalizableMessage(String bundlename, String key, Object... args) { |
43852
93a527059d8a
8174735: Update JAX-WS RI integration to latest version
aefimov
parents:
38822
diff
changeset
|
48 |
this(bundlename, null, key, args); |
12009 | 49 |
} |
50 |
||
38822
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
51 |
public LocalizableMessage(String bundlename, ResourceBundleSupplier rbSupplier, |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
52 |
String key, Object... args) { |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
53 |
_bundlename = bundlename; |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
54 |
_rbSupplier = rbSupplier; |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
55 |
_key = key; |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
56 |
if(args==null) |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
57 |
args = new Object[0]; |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
58 |
_args = args; |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
59 |
} |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
60 |
|
43852
93a527059d8a
8174735: Update JAX-WS RI integration to latest version
aefimov
parents:
38822
diff
changeset
|
61 |
@Override |
12009 | 62 |
public String getKey() { |
63 |
return _key; |
|
64 |
} |
|
65 |
||
43852
93a527059d8a
8174735: Update JAX-WS RI integration to latest version
aefimov
parents:
38822
diff
changeset
|
66 |
@Override |
12009 | 67 |
public Object[] getArguments() { |
16791 | 68 |
return Arrays.copyOf(_args, _args.length); |
12009 | 69 |
} |
70 |
||
43852
93a527059d8a
8174735: Update JAX-WS RI integration to latest version
aefimov
parents:
38822
diff
changeset
|
71 |
@Override |
12009 | 72 |
public String getResourceBundleName() { |
73 |
return _bundlename; |
|
74 |
} |
|
38822
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
75 |
|
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
76 |
@Override |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
77 |
public ResourceBundle getResourceBundle(Locale locale) { |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
78 |
if (_rbSupplier == null) |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
79 |
return null; |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
80 |
|
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
81 |
return _rbSupplier.getResourceBundle(locale); |
8cc53e29c1d9
8153944: wsimport and wsgen usage messages not printed
mchung
parents:
25871
diff
changeset
|
82 |
} |
12009 | 83 |
} |