javax.accessibility
Class AccessibleBundle

java.lang.Object
  extended by javax.accessibility.AccessibleBundle
Direct Known Subclasses:
AccessibleRelation, AccessibleRole, AccessibleState

public abstract class AccessibleBundle
extends Object

This serves as a base class for accessibility "enumerations". These objects are strongly typed; to make up for the lack of true enums in Java. Display should be locale dependent.

Since:
1.2
See Also:
AccessibleRole, AccessibleState

Field Summary
protected  String key
          The locale independent name of the object.
 
Constructor Summary
AccessibleBundle()
          Default constructor.
 
Method Summary
 String toDisplayString()
          Obtains the key as a localized string, using the default locale.
 String toDisplayString(Locale locale)
          Obtains the key as a localized string, falling back to the locale-independent version if necessary.
protected  String toDisplayString(String resourceBundle, Locale locale)
          Obtains the key as a localized string, falling back to the locale-independent version if necessary.
 String toString()
          Obtains the key as a localized string, using the default locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

key

protected String key
The locale independent name of the object. This is for the computer, not necessarily for humans; changing it in subclasses is frowned upon.

See Also:
toDisplayString(String, Locale)
Constructor Detail

AccessibleBundle

public AccessibleBundle()
Default constructor.

Method Detail

toDisplayString

protected String toDisplayString(String resourceBundle,
                                 Locale locale)
Obtains the key as a localized string, falling back to the locale-independent version if necessary.

Parameters:
resourceBundle - the resource to use for lookup
locale - the locale to translate to
Returns:
the translated name
Throws:
NullPointerException - if resourceBundle or locale is null

toDisplayString

public String toDisplayString(Locale locale)
Obtains the key as a localized string, falling back to the locale-independent version if necessary.

Parameters:
locale - the locale to translate to
Returns:
the translated name
Throws:
NullPointerException - if locale is null

toDisplayString

public String toDisplayString()
Obtains the key as a localized string, using the default locale.

Returns:
the translated name

toString

public String toString()
Obtains the key as a localized string, using the default locale.

Overrides:
toString in class Object
Returns:
the translated name
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)