com.sdm.quasar.client.core.dialogbase.services
Class AbstractResourceAccessService

java.lang.Object
  extended bycom.sdm.quasar.client.core.dialogbase.services.AbstractResourceAccessService
All Implemented Interfaces:
ResourceAccessService, Service
Direct Known Subclasses:
ConfigProviderResourceAccessService

public abstract class AbstractResourceAccessService
extends java.lang.Object
implements ResourceAccessService

Version:
1.$Revision$
Author:
Thomas Wolf

Constructor Summary
AbstractResourceAccessService()
          Creates a new AbstractResourceAccessService.
 
Method Summary
protected abstract  java.util.Locale getDefaultLocale()
          Returns the default Locale to be used.
protected abstract  java.lang.Object getParentResource(java.lang.String key, java.util.Locale locale)
          Asks a potential parent service for the resource with the key and locale given.
protected abstract  java.util.ResourceBundle[] getResourceBundles(java.util.Locale locale)
          Returns an array of resource bundles to look for (not null);
 java.lang.String getStringValue(java.lang.String key)
          Returns the resource String corresponding to the given resource key.
 java.lang.Object getValue(java.lang.Class keyClass)
          Returns the resource Object corresponding to the given resource key class.
 java.lang.Object getValue(java.lang.String key)
          Returns the resource Object corresponding to the given resource key.
 java.lang.Object getValue(java.lang.String key, java.util.Locale locale)
          Returns the resource Object corresponding to the given resource key.
 boolean hasValue(java.lang.Class keyClass)
          Returns true, iff there exists a resource object mapping for The key class will be converted to it's full qualified class name, under which the resource object must be specified.
 boolean hasValue(java.lang.String key)
          Returns true, iff there exists a resource object mapping for the given resource key.
 boolean hasValue(java.lang.String key, java.util.Locale locale)
          Returns true, iff there exists a resource object mapping for the given resource key in the specified language.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractResourceAccessService

public AbstractResourceAccessService()
Creates a new AbstractResourceAccessService.

Method Detail

getResourceBundles

protected abstract java.util.ResourceBundle[] getResourceBundles(java.util.Locale locale)
Returns an array of resource bundles to look for (not null);

Parameters:
locale - the Locale to get bundles for
Returns:
the ResourceBundles used

getDefaultLocale

protected abstract java.util.Locale getDefaultLocale()
Returns the default Locale to be used.


getParentResource

protected abstract java.lang.Object getParentResource(java.lang.String key,
                                                      java.util.Locale locale)
Asks a potential parent service for the resource with the key and locale given. Returns null if no parent exists or the parent cannot find the resource.

Parameters:
key - the key to the resource object (not null)
locale - the Locale to get values for

getValue

public java.lang.Object getValue(java.lang.String key,
                                 java.util.Locale locale)
Description copied from interface: ResourceAccessService
Returns the resource Object corresponding to the given resource key. If no resource value is defined for the key, null will be returned.

Specified by:
getValue in interface ResourceAccessService
Parameters:
key - the key to the resource object (not null)
locale - the Locale to get values for
Returns:
the value of the resource object, may be null.
See Also:
ResourceAccessService.getValue(java.lang.String, java.util.Locale)

hasValue

public boolean hasValue(java.lang.String key,
                        java.util.Locale locale)
Description copied from interface: ResourceAccessService
Returns true, iff there exists a resource object mapping for the given resource key in the specified language.

Specified by:
hasValue in interface ResourceAccessService
Parameters:
key - the key to the resource object (not null)
locale - the Locale to get values for
See Also:
ResourceAccessService.hasValue(java.lang.String, java.util.Locale)

getValue

public java.lang.Object getValue(java.lang.String key)
Description copied from interface: ResourceAccessService
Returns the resource Object corresponding to the given resource key. If no resource value is defined for the key, null will be returned.

Specified by:
getValue in interface ResourceAccessService
Parameters:
key - the key to the resource object (not null)
Returns:
the value of the resource object, may be null.
See Also:
ResourceAccessService.getValue(java.lang.String)

getStringValue

public java.lang.String getStringValue(java.lang.String key)
Description copied from interface: ResourceAccessService
Returns the resource String corresponding to the given resource key. If no resource value is defined for the key, null will be returned.

Specified by:
getStringValue in interface ResourceAccessService
Parameters:
key - the key to the resource object (not null)
Returns:
the value of the resource object, may be null.
See Also:
ResourceAccessService.getStringValue(java.lang.String)

getValue

public java.lang.Object getValue(java.lang.Class keyClass)
Description copied from interface: ResourceAccessService
Returns the resource Object corresponding to the given resource key class. The key class will be converted to it's full qualified class name, under which the resource object must be specified.

Specified by:
getValue in interface ResourceAccessService
Parameters:
keyClass - the key class (not null)
Returns:
the value of the resource object, may be null.
See Also:
ResourceAccessService.getValue(java.lang.Class)

hasValue

public boolean hasValue(java.lang.String key)
Description copied from interface: ResourceAccessService
Returns true, iff there exists a resource object mapping for the given resource key.

Specified by:
hasValue in interface ResourceAccessService
Parameters:
key - the key to the resource object (not null)
See Also:
ResourceAccessService.hasValue(java.lang.String)

hasValue

public boolean hasValue(java.lang.Class keyClass)
Description copied from interface: ResourceAccessService
Returns true, iff there exists a resource object mapping for The key class will be converted to it's full qualified class name, under which the resource object must be specified.

Specified by:
hasValue in interface ResourceAccessService
Parameters:
keyClass - the key class (not null)
See Also:
ResourceAccessService.hasValue(java.lang.Class)