org.norther.tammi.core.converter
Class DefaultLocaleConverter

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.core.converter.DefaultObjectConverter<Locale>
          extended by org.norther.tammi.core.converter.DefaultLocaleConverter
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Manageable, MBeanDelegate, LocaleConverter, ObjectConverter<Locale>

public class DefaultLocaleConverter
extends DefaultObjectConverter<Locale>
implements LocaleConverter

A converter for locales.

Version:
$Id: DefaultLocaleConverter.java,v 1.9 2009/09/28 15:08:42 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Constructor Summary
DefaultLocaleConverter()
          Constructs a new converter.
 
Method Summary
protected  Locale getComponentInstance(String className, Object object, String pattern)
          Gets an instance of the named component class by converting the source object and optionally applying the specified pattern.
protected  String toComponentString(String className, Object object, String pattern)
          Returns a string representation of an object of the named component class by optionally applying the specified pattern.
 String toString(String className, Object object, String pattern, Locale locale, ResourceBundle bundle)
          Returns a localized resource of the named class by optionally applying the specified pattern.
 
Methods inherited from class org.norther.tammi.core.converter.DefaultObjectConverter
fromLocalizedObject, getFormatPattern, getInstance, getInstance, getInstance, getLocalizedPattern, getResourceFinderName, postmanaged, setResourceFinderName, toLocalizedObject, toString, toString, toStrings, toStrings, toStrings, unmanaged
 
Methods inherited from class org.norther.tammi.core.base.Adaptee
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.norther.tammi.core.converter.ObjectConverter
getFormatPattern, getInstance, getInstance, getInstance, getLocalizedPattern, getResourceFinderName, setResourceFinderName, toString, toString, toStrings, toStrings, toStrings
 

Constructor Detail

DefaultLocaleConverter

public DefaultLocaleConverter()
Constructs a new converter.

Method Detail

toString

public String toString(String className,
                       Object object,
                       String pattern,
                       Locale locale,
                       ResourceBundle bundle)
Description copied from interface: ObjectConverter
Returns a localized resource of the named class by optionally applying the specified pattern.

Specified by:
toString in interface ObjectConverter<Locale>
Overrides:
toString in class DefaultObjectConverter<Locale>
Parameters:
className - the name of the class.
object - the source object.
pattern - the conversion pattern.
locale - the optional locale of the result.
bundle - the resource bundle to apply.
Returns:
the string resource.

getComponentInstance

protected Locale getComponentInstance(String className,
                                      Object object,
                                      String pattern)
                               throws ConversionException
Description copied from class: DefaultObjectConverter
Gets an instance of the named component class by converting the source object and optionally applying the specified pattern.

Overrides:
getComponentInstance in class DefaultObjectConverter<Locale>
Parameters:
className - the name of the class.
object - the source object.
pattern - an optional conversion pattern.
Returns:
the component instance.
Throws:
ConversionException - if conversion fails.

toComponentString

protected String toComponentString(String className,
                                   Object object,
                                   String pattern)
Description copied from class: DefaultObjectConverter
Returns a string representation of an object of the named component class by optionally applying the specified pattern.

Overrides:
toComponentString in class DefaultObjectConverter<Locale>
Parameters:
className - the name of the class.
object - the source object.
pattern - an optional conversion pattern.
Returns:
the string representation.


Copyright © 2004 The Norther Organization. All rights reserved.