org.norther.tammi.core.rt
Class DefaultVariableConverter

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.core.converter.DefaultObjectConverter<Variable>
          extended by org.norther.tammi.core.rt.DefaultVariableConverter
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Manageable, MBeanDelegate, ObjectConverter<Variable>, VariableConverter
Direct Known Subclasses:
ElementVariableConverter

public class DefaultVariableConverter
extends DefaultObjectConverter<Variable>
implements VariableConverter

A default implementation of VariableConverter.

Version:
$Id: DefaultVariableConverter.java,v 1.11 2009/09/28 15:08:45 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
DefaultVariableConverter()
          Constructs a new converter.
 
Method Summary
 Object getInstance(String className, Object object, String pattern)
          Gets an instance of the named class by converting the source object and optionally applying the specified pattern.
 Object getInstance(String className, Object object, String pattern, Locale locale, ResourceBundle bundle)
          Gets an instance of the named class by converting the localized source resource and optionally applying the specified pattern.
 ObjectName getVariableRegistryName()
          Gets the the variable registry of this converter.
 void postmanaged()
          This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.
 void setVariableRegistryName(ObjectName registry)
          Sets the variable registry of this converter.
 String toString(String className, Object object, String pattern)
          Returns a string representation of an object of the named 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.
 void unmanaged()
          This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.
 
Methods inherited from class org.norther.tammi.core.converter.DefaultObjectConverter
fromLocalizedObject, getComponentInstance, getFormatPattern, getInstance, getLocalizedPattern, getResourceFinderName, setResourceFinderName, toComponentString, toLocalizedObject, toString, toStrings, toStrings, toStrings
 
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, getLocalizedPattern, getResourceFinderName, setResourceFinderName, toString, toStrings, toStrings, toStrings
 

Constructor Detail

DefaultVariableConverter

public DefaultVariableConverter()
Constructs a new converter.

Method Detail

postmanaged

public void postmanaged()
Description copied from interface: Manageable
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.

Specified by:
postmanaged in interface Manageable
Overrides:
postmanaged in class DefaultObjectConverter<Variable>

unmanaged

public void unmanaged()
               throws Exception
Description copied from interface: Manageable
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.

Specified by:
unmanaged in interface Manageable
Overrides:
unmanaged in class DefaultObjectConverter<Variable>
Throws:
Exception - if the adaptee refused to be unmanaged.

getVariableRegistryName

public ObjectName getVariableRegistryName()
Description copied from interface: VariableConverter
Gets the the variable registry of this converter.

Specified by:
getVariableRegistryName in interface VariableConverter
Returns:
the object name of the variable registry or a query.

setVariableRegistryName

public void setVariableRegistryName(ObjectName registry)
Description copied from interface: VariableConverter
Sets the variable registry of this converter. If it is not set, the default one will be used.

Specified by:
setVariableRegistryName in interface VariableConverter
Parameters:
registry - the object name of the variable registry or a query.

getInstance

public Object getInstance(String className,
                          Object object,
                          String pattern)
                   throws ConversionException
Description copied from interface: ObjectConverter
Gets an instance of the named class by converting the source object and optionally applying the specified pattern.

Specified by:
getInstance in interface ObjectConverter<Variable>
Overrides:
getInstance in class DefaultObjectConverter<Variable>
Parameters:
className - the name of the class.
object - the source object.
pattern - an optional conversion pattern.
Returns:
the instance.
Throws:
ConversionException - if conversion fails.

getInstance

public Object getInstance(String className,
                          Object object,
                          String pattern,
                          Locale locale,
                          ResourceBundle bundle)
                   throws ConversionException
Description copied from interface: ObjectConverter
Gets an instance of the named class by converting the localized source resource and optionally applying the specified pattern.

Specified by:
getInstance in interface ObjectConverter<Variable>
Overrides:
getInstance in class DefaultObjectConverter<Variable>
Parameters:
className - the name of the class.
object - the source object.
pattern - an optional conversion pattern.
locale - the locale of the source object.
bundle - the resource bundle to apply.
Returns:
the instance.
Throws:
ConversionException - if conversion fails.

toString

public String toString(String className,
                       Object object,
                       String pattern)
Description copied from interface: ObjectConverter
Returns a string representation of an object of the named class by optionally applying the specified pattern.

Specified by:
toString in interface ObjectConverter<Variable>
Overrides:
toString in class DefaultObjectConverter<Variable>
Parameters:
className - the name of the class.
object - the source object.
pattern - an optional conversion pattern.
Returns:
the string representation.

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<Variable>
Overrides:
toString in class DefaultObjectConverter<Variable>
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.


Copyright © 2004 The Norther Organization. All rights reserved.