public final class Messages
extends java.lang.Object
Messages.properties
.Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DEFAULT_RESOURCE
Default name for resource bundle containing the messages.
|
private static java.util.ResourceBundle |
defaultResource
Cached resource bundle containing the messages.
|
Modifier | Constructor and Description |
---|---|
private |
Messages()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
get(java.lang.String key)
Get runtime message using supplied key.
|
static java.lang.String |
get(java.lang.String key,
java.lang.Object param1)
Get runtime message using supplied key and substitute parameter
into message.
|
private static java.lang.String |
get(java.lang.String key,
java.lang.Object[] arguments)
Get runtime error using supplied key and substitute parameters
into message.
|
(package private) static java.lang.String |
get(java.lang.String key,
java.lang.Object param1,
java.lang.Object param2)
Get runtime message using supplied key and substitute parameters
into message.
|
(package private) static void |
loadDriverProperties(java.util.Map propertyMap,
java.util.Map descriptionMap)
Retrieve the list of driver property names and driver property
descriptions from
Messages.properties and populate
them into Map objects. |
private static java.util.ResourceBundle |
loadResourceBundle()
Load the
DEFAULT_RESOURCE resource bundle. |
private static final java.lang.String DEFAULT_RESOURCE
private static java.util.ResourceBundle defaultResource
ResourceBundle
does caching internally but this caching
involves a lot of string operations to generate the keys used for
caching, leading to a lot of StringBuffer
reallocation. In
one run through the complete jTDS test suite there were over 60000
allocations and reallocations (about one for each get()
call).
private Messages()
public static java.lang.String get(java.lang.String key)
key
- The key of the message in Messages.propertiesString
.public static java.lang.String get(java.lang.String key, java.lang.Object param1)
key
- The key of the message in Messages.propertiesparam1
- The object to insert into message.String
.static java.lang.String get(java.lang.String key, java.lang.Object param1, java.lang.Object param2)
key
- The key of the message in Messages.propertiesparam1
- The object to insert into message.param2
- The object to insert into message.String
.private static java.lang.String get(java.lang.String key, java.lang.Object[] arguments)
key
- The key of the error message in Messages.propertiesarguments
- The objects to insert into the message.String
.static void loadDriverProperties(java.util.Map propertyMap, java.util.Map descriptionMap)
Messages.properties
and populate
them into Map
objects.
The keys used to populate both propertyMap
and
descriptionMap
are guaranteed to match up as long
as the properties defined in Messages.properties
are well-formed.propertyMap
- The map of property names to be populated.descriptionMap
- The map of property descriptions to be populated.private static java.util.ResourceBundle loadResourceBundle()
DEFAULT_RESOURCE
resource bundle.Generated on June 8 2013