org.norther.tammi.acorn.locale
Interface Localizer

All Known Subinterfaces:
FallbackMap, HostFilter<F>, Logger, PipeFilter<F>, ResourceFilter, ResourceMap, ServiceFilter<F>, ThreadedLogger
All Known Implementing Classes:
AbstractLogger, AbstractThreadedLogger, DefaultFallbackMap, DefaultHostFilter, DefaultPipeFilter, DefaultResourceFilter, DefaultResourceMap, DefaultServiceFilter, JDK4Logger, Log4JLogger

public interface Localizer

An interface to localizers capable of resolving localized resources.

Version:
$Id: Localizer.java,v 1.5 2009/11/13 16:31:47 cvsimp Exp $
Author:
Ilkka Priha

Field Summary
static String ANY_NAME
          The wildcard.
 
Method Summary
 Object resolveLocalizedObject(String name, String key, Locale... locale)
          Resolves a localized object for the qualified name, key and locale.
 Object resolveLocalizedResource(String name, String key, Locale... locale)
          Resolves a localized resource for the qualified name, key and locale.
 String resolveLocalizedString(String name, String key, Locale... locale)
          Resolves a localized string for the qualified name, key and locale.
 String[] resolveLocalizedStrings(String name, String key, Locale... locale)
          Resolves a localized string array for the qualified name, key and locale.
 

Field Detail

ANY_NAME

static final String ANY_NAME
The wildcard.

See Also:
Constant Field Values
Method Detail

resolveLocalizedResource

Object resolveLocalizedResource(String name,
                                String key,
                                Locale... locale)
Resolves a localized resource for the qualified name, key and locale. A localized resource mapped to the key and defined for the most specific package of the qualified name is returned. If no qualified resource is available, the key is returned unmodified.

If the qualified name is a wildcard "*", the first mapped resource regardless of its package is returned.

Parameters:
name - the qualified name.
key - the resource key.
locale - the locale.
Returns:
the localized resource or the key if not found.

resolveLocalizedObject

Object resolveLocalizedObject(String name,
                              String key,
                              Locale... locale)
Resolves a localized object for the qualified name, key and locale.

Parameters:
name - the qualified name.
key - the resource key.
locale - the locale.
Returns:
the localized object or the key if not found.

resolveLocalizedString

String resolveLocalizedString(String name,
                              String key,
                              Locale... locale)
Resolves a localized string for the qualified name, key and locale.

Parameters:
name - the qualified name.
key - the resource key.
locale - the locale.
Returns:
the localized string or the key if not found.

resolveLocalizedStrings

String[] resolveLocalizedStrings(String name,
                                 String key,
                                 Locale... locale)
Resolves a localized string array for the qualified name, key and locale.

Parameters:
name - the qualified name.
key - the resource key.
locale - the locale.
Returns:
the localized string array or the key in an array if not found.


Copyright © 2004 The Norther Organization. All rights reserved.