net.sourceforge.jtds.jdbc
Class Messages
java.lang.Object
net.sourceforge.jtds.jdbc.Messages
public final class Messages
extends java.lang.Object
Support class for Messages.properties
.
$Id: Messages.java,v 1.8 2005/04/20 16:49:22 alin_sinpalean Exp $- David D. Kilzer
- Mike Hutchinson
private static String | DEFAULT_RESOURCE - Default name for resource bundle containing the messages.
|
private static ResourceBundle | defaultResource - Cached resource bundle containing the messages.
|
static String | get(String key) - Get runtime message using supplied key.
|
static String | get(String key, Object param1) - Get runtime message using supplied key and substitute parameter
into message.
|
(package private) static String | get(String key, Object param1, Object param2) - Get runtime message using supplied key and substitute parameters
into message.
|
private static String | get(String key, Object[] arguments) - Get runtime error using supplied key and substitute parameters
into message.
|
(package private) static void | loadDriverProperties(Map propertyMap, Map descriptionMap) - Retrieve the list of driver property names and driver property
descriptions from
Messages.properties and populate
them into Map objects.
|
private static ResourceBundle | loadResourceBundle() - Load the
DEFAULT_RESOURCE resource bundle.
|
DEFAULT_RESOURCE
private static final String DEFAULT_RESOURCE
Default name for resource bundle containing the messages.
defaultResource
private static ResourceBundle defaultResource
Cached resource bundle containing the messages.
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).
Messages
private Messages()
Default constructor. Private to prevent instantiation.
get
public static String get(String key)
Get runtime message using supplied key.
key
- The key of the message in Messages.properties
- The selected message as a
String
.
get
public static String get(String key,
Object param1)
Get runtime message using supplied key and substitute parameter
into message.
key
- The key of the message in Messages.propertiesparam1
- The object to insert into message.
- The selected message as a
String
.
get
(package private) static String get(String key,
Object param1,
Object param2)
Get runtime message using supplied key and substitute parameters
into message.
key
- The key of the message in Messages.propertiesparam1
- The object to insert into message.param2
- The object to insert into message.
- The selected message as a
String
.
get
private static String get(String key,
Object[] arguments)
Get runtime error using supplied key and substitute parameters
into message.
key
- The key of the error message in Messages.propertiesarguments
- The objects to insert into the message.
- The selected error message as a
String
.
loadDriverProperties
(package private) static void loadDriverProperties(Map propertyMap,
Map descriptionMap)
Retrieve the list of driver property names and driver property
descriptions from
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.
loadResourceBundle
private static ResourceBundle loadResourceBundle()
Generated on June 12 2008