jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
29 |
29 |
30 import java.util.Arrays; |
30 import java.util.Arrays; |
31 import java.util.Locale; |
31 import java.util.Locale; |
32 import java.util.ResourceBundle; |
32 import java.util.ResourceBundle; |
33 |
33 |
|
34 |
34 /** |
35 /** |
35 * @author WS Development Team |
36 * @author WS Development Team |
36 */ |
37 */ |
37 public final class LocalizableMessage implements Localizable { |
38 public final class LocalizableMessage implements Localizable { |
38 |
39 |
40 private final ResourceBundleSupplier _rbSupplier; |
41 private final ResourceBundleSupplier _rbSupplier; |
41 |
42 |
42 private final String _key; |
43 private final String _key; |
43 private final Object[] _args; |
44 private final Object[] _args; |
44 |
45 |
|
46 @Deprecated |
45 public LocalizableMessage(String bundlename, String key, Object... args) { |
47 public LocalizableMessage(String bundlename, String key, Object... args) { |
46 _bundlename = bundlename; |
48 this(bundlename, null, key, args); |
47 _rbSupplier = null; |
|
48 _key = key; |
|
49 if(args==null) |
|
50 args = new Object[0]; |
|
51 _args = args; |
|
52 } |
49 } |
53 |
50 |
54 public LocalizableMessage(String bundlename, ResourceBundleSupplier rbSupplier, |
51 public LocalizableMessage(String bundlename, ResourceBundleSupplier rbSupplier, |
55 String key, Object... args) { |
52 String key, Object... args) { |
56 _bundlename = bundlename; |
53 _bundlename = bundlename; |
59 if(args==null) |
56 if(args==null) |
60 args = new Object[0]; |
57 args = new Object[0]; |
61 _args = args; |
58 _args = args; |
62 } |
59 } |
63 |
60 |
64 |
61 @Override |
65 public String getKey() { |
62 public String getKey() { |
66 return _key; |
63 return _key; |
67 } |
64 } |
68 |
65 |
|
66 @Override |
69 public Object[] getArguments() { |
67 public Object[] getArguments() { |
70 return Arrays.copyOf(_args, _args.length); |
68 return Arrays.copyOf(_args, _args.length); |
71 } |
69 } |
72 |
70 |
|
71 @Override |
73 public String getResourceBundleName() { |
72 public String getResourceBundleName() { |
74 return _bundlename; |
73 return _bundlename; |
75 } |
74 } |
76 |
75 |
77 @Override |
76 @Override |