| | |
| | | { |
| | | |
| | | /** |
| | | * Cached copy of the message created by this descriptor. We can get |
| | | * away with this for the zero argument message because it is |
| | | * immutable. |
| | | * Cached copy of the message created by this descriptor. We can get away |
| | | * with this for the zero argument message because it is immutable. |
| | | */ |
| | | private final LocalizableMessage message; |
| | | |
| | |
| | | * @param classLoader |
| | | * the class loader to be used to get the ResourceBundle |
| | | */ |
| | | public Arg0(String rbBase, String key, ClassLoader classLoader) |
| | | public Arg0(final String rbBase, final String key, |
| | | final ClassLoader classLoader) |
| | | { |
| | | super(rbBase, key, classLoader); |
| | | message = newMessage(this); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean requiresFormatter() |
| | | { |
| | | return requiresFormat; |
| | |
| | | * @param classLoader |
| | | * the class loader to be used to get the ResourceBundle |
| | | */ |
| | | public Arg1(String rbBase, String key, ClassLoader classLoader) |
| | | public Arg1(final String rbBase, final String key, |
| | | final ClassLoader classLoader) |
| | | { |
| | | super(rbBase, key, classLoader); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a message with arguments that will replace format |
| | | * specifiers in the assocated format string when the message is |
| | | * rendered to string representation. |
| | | * Creates a message with arguments that will replace format specifiers in |
| | | * the assocated format string when the message is rendered to string |
| | | * representation. |
| | | * |
| | | * @return LocalizableMessage object |
| | | * @param a1 |
| | | * message argument |
| | | */ |
| | | public LocalizableMessage get(T1 a1) |
| | | public LocalizableMessage get(final T1 a1) |
| | | { |
| | | return newMessage(this, a1); |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean requiresFormatter() |
| | | { |
| | | return true; |
| | |
| | | * @param classLoader |
| | | * the class loader to be used to get the ResourceBundle |
| | | */ |
| | | public Arg2(String rbBase, String key, ClassLoader classLoader) |
| | | public Arg2(final String rbBase, final String key, |
| | | final ClassLoader classLoader) |
| | | { |
| | | super(rbBase, key, classLoader); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a message with arguments that will replace format |
| | | * specifiers in the assocated format string when the message is |
| | | * rendered to string representation. |
| | | * Creates a message with arguments that will replace format specifiers in |
| | | * the assocated format string when the message is rendered to string |
| | | * representation. |
| | | * |
| | | * @return LocalizableMessage object |
| | | * @param a1 |
| | |
| | | * @param a2 |
| | | * message argument |
| | | */ |
| | | public LocalizableMessage get(T1 a1, T2 a2) |
| | | public LocalizableMessage get(final T1 a1, final T2 a2) |
| | | { |
| | | return newMessage(this, a1, a2); |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean requiresFormatter() |
| | | { |
| | | return true; |
| | |
| | | * @param <T3> |
| | | * The type of the third message argument. |
| | | */ |
| | | public static final class Arg3<T1, T2, T3> extends LocalizableMessageDescriptor |
| | | public static final class Arg3<T1, T2, T3> extends |
| | | LocalizableMessageDescriptor |
| | | { |
| | | |
| | | /** |
| | |
| | | * @param classLoader |
| | | * the class loader to be used to get the ResourceBundle |
| | | */ |
| | | public Arg3(String rbBase, String key, ClassLoader classLoader) |
| | | public Arg3(final String rbBase, final String key, |
| | | final ClassLoader classLoader) |
| | | { |
| | | super(rbBase, key, classLoader); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a message with arguments that will replace format |
| | | * specifiers in the assocated format string when the message is |
| | | * rendered to string representation. |
| | | * Creates a message with arguments that will replace format specifiers in |
| | | * the assocated format string when the message is rendered to string |
| | | * representation. |
| | | * |
| | | * @return LocalizableMessage object |
| | | * @param a1 |
| | |
| | | * @param a3 |
| | | * message argument |
| | | */ |
| | | public LocalizableMessage get(T1 a1, T2 a2, T3 a3) |
| | | public LocalizableMessage get(final T1 a1, final T2 a2, final T3 a3) |
| | | { |
| | | return newMessage(this, a1, a2, a3); |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean requiresFormatter() |
| | | { |
| | | return true; |
| | |
| | | * @param classLoader |
| | | * the class loader to be used to get the ResourceBundle |
| | | */ |
| | | public Arg4(String rbBase, String key, ClassLoader classLoader) |
| | | public Arg4(final String rbBase, final String key, |
| | | final ClassLoader classLoader) |
| | | { |
| | | super(rbBase, key, classLoader); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a message with arguments that will replace format |
| | | * specifiers in the assocated format string when the message is |
| | | * rendered to string representation. |
| | | * Creates a message with arguments that will replace format specifiers in |
| | | * the assocated format string when the message is rendered to string |
| | | * representation. |
| | | * |
| | | * @return LocalizableMessage object |
| | | * @param a1 |
| | |
| | | * @param a4 |
| | | * message argument |
| | | */ |
| | | public LocalizableMessage get(T1 a1, T2 a2, T3 a3, T4 a4) |
| | | public LocalizableMessage get(final T1 a1, final T2 a2, final T3 a3, |
| | | final T4 a4) |
| | | { |
| | | return newMessage(this, a1, a2, a3, a4); |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean requiresFormatter() |
| | | { |
| | | return true; |
| | |
| | | * @param classLoader |
| | | * the class loader to be used to get the ResourceBundle |
| | | */ |
| | | public Arg5(String rbBase, String key, ClassLoader classLoader) |
| | | public Arg5(final String rbBase, final String key, |
| | | final ClassLoader classLoader) |
| | | { |
| | | super(rbBase, key, classLoader); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a message with arguments that will replace format |
| | | * specifiers in the assocated format string when the message is |
| | | * rendered to string representation. |
| | | * Creates a message with arguments that will replace format specifiers in |
| | | * the assocated format string when the message is rendered to string |
| | | * representation. |
| | | * |
| | | * @return LocalizableMessage object |
| | | * @param a1 |
| | |
| | | * @param a5 |
| | | * message argument |
| | | */ |
| | | public LocalizableMessage get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) |
| | | public LocalizableMessage get(final T1 a1, final T2 a2, final T3 a3, |
| | | final T4 a4, final T5 a5) |
| | | { |
| | | return newMessage(this, a1, a2, a3, a4, a5); |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean requiresFormatter() |
| | | { |
| | | return true; |
| | |
| | | * @param classLoader |
| | | * the class loader to be used to get the ResourceBundle |
| | | */ |
| | | public Arg6(String rbBase, String key, ClassLoader classLoader) |
| | | public Arg6(final String rbBase, final String key, |
| | | final ClassLoader classLoader) |
| | | { |
| | | super(rbBase, key, classLoader); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a message with arguments that will replace format |
| | | * specifiers in the assocated format string when the message is |
| | | * rendered to string representation. |
| | | * Creates a message with arguments that will replace format specifiers in |
| | | * the assocated format string when the message is rendered to string |
| | | * representation. |
| | | * |
| | | * @return LocalizableMessage object |
| | | * @param a1 |
| | |
| | | * @param a6 |
| | | * message argument |
| | | */ |
| | | public LocalizableMessage get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) |
| | | public LocalizableMessage get(final T1 a1, final T2 a2, final T3 a3, |
| | | final T4 a4, final T5 a5, final T6 a6) |
| | | { |
| | | return newMessage(this, a1, a2, a3, a4, a5, a6); |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean requiresFormatter() |
| | | { |
| | | return true; |
| | |
| | | * @param classLoader |
| | | * the class loader to be used to get the ResourceBundle |
| | | */ |
| | | public Arg7(String rbBase, String key, ClassLoader classLoader) |
| | | public Arg7(final String rbBase, final String key, |
| | | final ClassLoader classLoader) |
| | | { |
| | | super(rbBase, key, classLoader); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a message with arguments that will replace format |
| | | * specifiers in the assocated format string when the message is |
| | | * rendered to string representation. |
| | | * Creates a message with arguments that will replace format specifiers in |
| | | * the assocated format string when the message is rendered to string |
| | | * representation. |
| | | * |
| | | * @return LocalizableMessage object |
| | | * @param a1 |
| | |
| | | * @param a7 |
| | | * message argument |
| | | */ |
| | | public LocalizableMessage get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7) |
| | | public LocalizableMessage get(final T1 a1, final T2 a2, final T3 a3, |
| | | final T4 a4, final T5 a5, final T6 a6, final T7 a7) |
| | | { |
| | | return newMessage(this, a1, a2, a3, a4, a5, a6, a7); |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean requiresFormatter() |
| | | { |
| | | return true; |
| | |
| | | * @param <T8> |
| | | * The type of the eighth message argument. |
| | | */ |
| | | public static final class Arg8<T1, T2, T3, T4, T5, T6, T7, T8> |
| | | extends LocalizableMessageDescriptor |
| | | public static final class Arg8<T1, T2, T3, T4, T5, T6, T7, T8> extends |
| | | LocalizableMessageDescriptor |
| | | { |
| | | |
| | | /** |
| | |
| | | * @param classLoader |
| | | * the class loader to be used to get the ResourceBundle |
| | | */ |
| | | public Arg8(String rbBase, String key, ClassLoader classLoader) |
| | | public Arg8(final String rbBase, final String key, |
| | | final ClassLoader classLoader) |
| | | { |
| | | super(rbBase, key, classLoader); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a message with arguments that will replace format |
| | | * specifiers in the assocated format string when the message is |
| | | * rendered to string representation. |
| | | * Creates a message with arguments that will replace format specifiers in |
| | | * the assocated format string when the message is rendered to string |
| | | * representation. |
| | | * |
| | | * @return LocalizableMessage object |
| | | * @param a1 |
| | |
| | | * @param a8 |
| | | * message argument |
| | | */ |
| | | public LocalizableMessage get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, |
| | | T8 a8) |
| | | public LocalizableMessage get(final T1 a1, final T2 a2, final T3 a3, |
| | | final T4 a4, final T5 a5, final T6 a6, final T7 a7, final T8 a8) |
| | | { |
| | | return newMessage(this, a1, a2, a3, a4, a5, a6, a7, a8); |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean requiresFormatter() |
| | | { |
| | | return true; |
| | |
| | | * @param <T9> |
| | | * The type of the ninth message argument. |
| | | */ |
| | | public static final class Arg9<T1, T2, T3, T4, T5, T6, T7, T8, T9> |
| | | extends LocalizableMessageDescriptor |
| | | public static final class Arg9<T1, T2, T3, T4, T5, T6, T7, T8, T9> extends |
| | | LocalizableMessageDescriptor |
| | | { |
| | | |
| | | /** |
| | |
| | | * @param classLoader |
| | | * the class loader to be used to get the ResourceBundle |
| | | */ |
| | | public Arg9(String rbBase, String key, ClassLoader classLoader) |
| | | public Arg9(final String rbBase, final String key, |
| | | final ClassLoader classLoader) |
| | | { |
| | | super(rbBase, key, classLoader); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a message with arguments that will replace format |
| | | * specifiers in the assocated format string when the message is |
| | | * rendered to string representation. |
| | | * Creates a message with arguments that will replace format specifiers in |
| | | * the assocated format string when the message is rendered to string |
| | | * representation. |
| | | * |
| | | * @return LocalizableMessage object |
| | | * @param a1 |
| | |
| | | * @param a9 |
| | | * message argument |
| | | */ |
| | | public LocalizableMessage get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, |
| | | T8 a8, T9 a9) |
| | | public LocalizableMessage get(final T1 a1, final T2 a2, final T3 a3, |
| | | final T4 a4, final T5 a5, final T6 a6, final T7 a7, final T8 a8, |
| | | final T9 a9) |
| | | { |
| | | return newMessage(this, a1, a2, a3, a4, a5, a6, a7, a8, a9); |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean requiresFormatter() |
| | | { |
| | | return true; |
| | |
| | | |
| | | |
| | | /** |
| | | * Subclass for creating messages with an any number of arguments. In |
| | | * general this class should be used when a message needs to be |
| | | * defined with more arguments that can be handled with the current |
| | | * number of subclasses |
| | | * Subclass for creating messages with an any number of arguments. In general |
| | | * this class should be used when a message needs to be defined with more |
| | | * arguments that can be handled with the current number of subclasses |
| | | */ |
| | | public static final class ArgN extends LocalizableMessageDescriptor |
| | | { |
| | |
| | | * @param classLoader |
| | | * the class loader to be used to get the ResourceBundle |
| | | */ |
| | | public ArgN(String rbBase, String key, ClassLoader classLoader) |
| | | public ArgN(final String rbBase, final String key, |
| | | final ClassLoader classLoader) |
| | | { |
| | | super(rbBase, key, classLoader); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a message with arguments that will replace format |
| | | * specifiers in the assocated format string when the message is |
| | | * rendered to string representation. |
| | | * Creates a message with arguments that will replace format specifiers in |
| | | * the assocated format string when the message is rendered to string |
| | | * representation. |
| | | * |
| | | * @return LocalizableMessage object |
| | | * @param args |
| | | * message arguments |
| | | */ |
| | | public LocalizableMessage get(Object... args) |
| | | public LocalizableMessage get(final Object... args) |
| | | { |
| | | return newMessage(this, args); |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean requiresFormatter() |
| | | { |
| | | return true; |
| | |
| | | |
| | | |
| | | /** |
| | | * A descriptor for creating a raw message from a <code>String</code>. |
| | | * In general this descriptor should NOT be used internally. OpenDS |
| | | * plugins may want to use the mechanism to create messages without |
| | | * storing their strings in resource bundles. |
| | | */ |
| | | public static final class Raw extends LocalizableMessageDescriptor |
| | | { |
| | | |
| | | private final String formatString; |
| | | |
| | | private final boolean requiresFormatter; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a parameterized instance. |
| | | * |
| | | * @param formatString |
| | | * for created messages |
| | | */ |
| | | public Raw(CharSequence formatString) |
| | | { |
| | | super(null, null, null); |
| | | this.formatString = formatString != null ? formatString |
| | | .toString() : ""; |
| | | this.requiresFormatter = this.formatString.matches(".*%.*"); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a message with arguments that will replace format |
| | | * specifiers in the assocated format string when the message is |
| | | * rendered to string representation. |
| | | * |
| | | * @return LocalizableMessage object |
| | | * @param args |
| | | * message arguments |
| | | */ |
| | | public LocalizableMessage get(Object... args) |
| | | { |
| | | return newMessage(this, args); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Overridden in order to bypass the resource bundle plumbing and |
| | | * return the format string directly. |
| | | * |
| | | * @param locale |
| | | * ignored |
| | | * @return format string |
| | | */ |
| | | public String getFormatString(Locale locale) |
| | | { |
| | | return this.formatString; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean requiresFormatter() |
| | | { |
| | | return this.requiresFormatter; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | // Container for caching the last locale specific format string. |
| | | private static final class CachedFormatString |
| | | { |
| | | private final Locale locale; |
| | | |
| | | private final String formatString; |
| | | |
| | | |
| | | |
| | | private CachedFormatString(Locale locale, String formatString) |
| | | { |
| | | this.locale = locale; |
| | | this.formatString = formatString; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Factory interface for creating messages. Only LocalizableMessage should |
| | | * implement this. |
| | | */ |
| | |
| | | * The message parameters. |
| | | * @return The new message. |
| | | */ |
| | | LocalizableMessage newMessage(LocalizableMessageDescriptor descriptor, Object... args); |
| | | LocalizableMessage newMessage(LocalizableMessageDescriptor descriptor, |
| | | Object... args); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * A descriptor for creating a raw message from a <code>String</code>. In |
| | | * general this descriptor should NOT be used internally. OpenDS plugins may |
| | | * want to use the mechanism to create messages without storing their strings |
| | | * in resource bundles. |
| | | */ |
| | | public static final class Raw extends LocalizableMessageDescriptor |
| | | { |
| | | |
| | | private final String formatString; |
| | | |
| | | private final boolean requiresFormatter; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a parameterized instance. |
| | | * |
| | | * @param formatString |
| | | * for created messages |
| | | */ |
| | | public Raw(final CharSequence formatString) |
| | | { |
| | | super(null, null, null); |
| | | this.formatString = formatString != null ? formatString.toString() : ""; |
| | | this.requiresFormatter = this.formatString.matches(".*%.*"); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a message with arguments that will replace format specifiers in |
| | | * the assocated format string when the message is rendered to string |
| | | * representation. |
| | | * |
| | | * @return LocalizableMessage object |
| | | * @param args |
| | | * message arguments |
| | | */ |
| | | public LocalizableMessage get(final Object... args) |
| | | { |
| | | return newMessage(this, args); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Overridden in order to bypass the resource bundle plumbing and return the |
| | | * format string directly. |
| | | * |
| | | * @param locale |
| | | * ignored |
| | | * @return format string |
| | | */ |
| | | @Override |
| | | public String getFormatString(final Locale locale) |
| | | { |
| | | return this.formatString; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean requiresFormatter() |
| | | { |
| | | return this.requiresFormatter; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | // Container for caching the last locale specific format string. |
| | | private static final class CachedFormatString |
| | | { |
| | | private final Locale locale; |
| | | |
| | | private final String formatString; |
| | | |
| | | |
| | | |
| | | private CachedFormatString(final Locale locale, final String formatString) |
| | | { |
| | | this.locale = locale; |
| | | this.formatString = formatString; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | * We use a factory for creating LocalizableMessage objects in order to avoid |
| | | * exposing this class in the public API. |
| | | */ |
| | | public static MessageFactory MESSAGE_FACTORY; |
| | | public static MessageFactory messageFactory; |
| | | |
| | | // Force MESSAGE_FACTORY to be set. |
| | | // Force messageFactory to be set. |
| | | static |
| | | { |
| | | try |
| | | { |
| | | Class.forName("org.opends.sdk.LocalizableMessage"); |
| | | } |
| | | catch (ClassNotFoundException e) |
| | | catch (final ClassNotFoundException e) |
| | | { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether or not formatting should be applied to the given |
| | | * format string. Note that a format string might have literal |
| | | * specifiers (%% or %n for example) that require formatting but are |
| | | * not replaced by arguments. |
| | | * Indicates whether or not formatting should be applied to the given format |
| | | * string. Note that a format string might have literal specifiers (%% or %n |
| | | * for example) that require formatting but are not replaced by arguments. |
| | | * |
| | | * @param s |
| | | * candidate for formatting |
| | | * @return boolean where true indicates that the format string |
| | | * requires formatting |
| | | * @return boolean where true indicates that the format string requires |
| | | * formatting |
| | | */ |
| | | private static final boolean containsArgumentLiterals(String s) |
| | | private static final boolean containsArgumentLiterals(final String s) |
| | | { |
| | | return s.matches(".*%[n|%].*"); // match Formatter literals |
| | | } |
| | | |
| | | |
| | | |
| | | private static LocalizableMessage newMessage(LocalizableMessageDescriptor descriptor, |
| | | Object... args) |
| | | private static LocalizableMessage newMessage( |
| | | final LocalizableMessageDescriptor descriptor, final Object... args) |
| | | { |
| | | return MESSAGE_FACTORY.newMessage(descriptor, args); |
| | | return messageFactory.newMessage(descriptor, args); |
| | | } |
| | | |
| | | |
| | |
| | | private final String key; |
| | | |
| | | /* |
| | | * The class loader to be used to retrieve the ResourceBundle. If null |
| | | * the default class loader will be used. |
| | | * The class loader to be used to retrieve the ResourceBundle. If null the |
| | | * default class loader will be used. |
| | | */ |
| | | private final ClassLoader classLoader; |
| | | |
| | |
| | | * @param classLoader |
| | | * the class loader to be used to get the ResourceBundle |
| | | */ |
| | | private LocalizableMessageDescriptor(String rbBase, String key, |
| | | ClassLoader classLoader) |
| | | private LocalizableMessageDescriptor(final String rbBase, final String key, |
| | | final ClassLoader classLoader) |
| | | { |
| | | this.rbBase = rbBase; |
| | | this.key = key; |
| | |
| | | |
| | | |
| | | /** |
| | | * Returns the format string which should be used when creating the |
| | | * string representation of this message using the specified locale. |
| | | * Returns the format string which should be used when creating the string |
| | | * representation of this message using the specified locale. |
| | | * |
| | | * @param locale |
| | | * The locale. |
| | |
| | | * @throws NullPointerException |
| | | * If {@code locale} was {@code null}. |
| | | */ |
| | | public String getFormatString(Locale locale) |
| | | public String getFormatString(final Locale locale) |
| | | throws NullPointerException |
| | | { |
| | | Validator.ensureNotNull(locale); |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether or not this descriptor format string should be |
| | | * processed by {@code Formatter} during string rendering. |
| | | * Indicates whether or not this descriptor format string should be processed |
| | | * by {@code Formatter} during string rendering. |
| | | * |
| | | * @return {@code true} if a {@code Formatter} should be used, |
| | | * otherwise {@code false}. |
| | | * @return {@code true} if a {@code Formatter} should be used, otherwise |
| | | * {@code false}. |
| | | */ |
| | | public abstract boolean requiresFormatter(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Returns the format string which should be used when creating the string |
| | | * representation of this message using the default locale. |
| | | * |
| | | * @return The format string. |
| | | */ |
| | | final String getFormatString() |
| | | { |
| | | return getFormatString(Locale.getDefault()); |
| | | } |
| | | |
| | | |
| | | |
| | | private ResourceBundle getBundle(Locale locale) |
| | | { |
| | | if (locale == null) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Returns the format string which should be used when creating the |
| | | * string representation of this message using the default locale. |
| | | * |
| | | * @return The format string. |
| | | */ |
| | | final String getFormatString() |
| | | { |
| | | return getFormatString(Locale.getDefault()); |
| | | } |
| | | |
| | | } |