Class NLS
- Direct Known Subclasses:
- CompareMessages,- E4DialogMessages,- ExtensionEventHandlerMessages,- MarkerMessages,- Messages,- Messages,- Messages,- WorkbenchMessages
 The #bind methods perform string substitution and should be considered a
 convenience and not a full substitute replacement for MessageFormat#format
 method calls.
 
 Text appearing within curly braces in the given message, will be interpreted
 as a numeric index to the corresponding substitution object in the given array. Calling
 the #bind methods with text that does not map to an integer will result in an
 IllegalArgumentException.
 
Text appearing within single quotes is treated as a literal. A single quote is escaped by a preceeding single quote.
 Clients who wish to use the full substitution power of the MessageFormat class should
 call that class directly and not use these #bind methods.
 
Clients may subclass this type.
- Since:
- 3.1
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringBind the given message's substitution locations with the given string value.static StringBind the given message's substitution locations with the given string values.static <T> StringBind the given message's substitution locations with the given string values.static voidinitializeMessages(String baseName, Class<?> clazz) Initialize the given class with the values from the message properties specified by the base name.
- 
Constructor Details- 
NLSprotected NLS()Creates a new NLS instance.
 
- 
- 
Method Details- 
bindBind the given message's substitution locations with the given string value.- Parameters:
- message- the message to be manipulated
- binding- the object to be inserted into the message
- Returns:
- the manipulated String
- Throws:
- IllegalArgumentException- if the text appearing within curly braces in the given message does not map to an integer
 
- 
bindBind the given message's substitution locations with the given string values.- Parameters:
- message- the message to be manipulated
- binding1- An object to be inserted into the message
- binding2- A second object to be inserted into the message
- Returns:
- the manipulated String
- Throws:
- IllegalArgumentException- if the text appearing within curly braces in the given message does not map to an integer
 
- 
bindBind the given message's substitution locations with the given string values.- Parameters:
- message- the message to be manipulated
- bindings- An array of objects to be inserted into the message
- Returns:
- the manipulated String
- Throws:
- IllegalArgumentException- if the text appearing within curly braces in the given message does not map to an integer
 
- 
initializeMessagesInitialize the given class with the values from the message properties specified by the base name. The base name specifies a fully qualified base name to a message properties file, including the package where the message properties file is located. The class loader of the specified class will be used to load the message properties resources.For example, if the locale is set to en_US and org.eclipse.example.nls.messagesis used as the base name then the following resources will be searched using the class loader of the specified class:org/eclipse/example/nls/messages_en_US.properties org/eclipse/example/nls/messages_en.properties org/eclipse/example/nls/messages.properties The properties files are read using the default encoding for resource bundles: - In Java 8, resource files are read using ISO-8859-1 character encoding.
 Characters outside its range must be represented using Unicode escape
 sequences (e.g., \uXXXX).
- In Java 11 and later, resource files are initially read using UTF-8 character encoding. If a resource cannot be successfully read in UTF-8, it will be read from the start in ISO-8859-1 character encoding.
 - Parameters:
- baseName- the base name of a fully qualified message properties file.
- clazz- the class where the constants will exist
 
- In Java 8, resource files are read using ISO-8859-1 character encoding.
 Characters outside its range must be represented using Unicode escape
 sequences (e.g., 
 
-