org.norther.tammi.core.mail
Class DefaultInternetAddressConverter

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.core.converter.DefaultObjectConverter
          extended by org.norther.tammi.core.mail.DefaultInternetAddressConverter
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Manageable, MBeanDelegate, ObjectConverter

public class DefaultInternetAddressConverter
extends DefaultObjectConverter

A converter for instances representing internet email addresses according to RFC822 .

Note that XML conversion is applied so that addresses may contain < and > signs.

Author:
Jari Petays
See Also:
Serialized Form

Field Summary
static String ADDR_PATTERN
          The pattern for plain address "A" specifies address being used as such and not converted to a RFC822/RFC2047 encoded mail-safe address.
static String INTERNET_ADDRESS_TYPE
          An internet address type.
static String LOOSE_SYNTAX
          The pattern for loose syntax "!" ignores the syntax of the address address formed by three parts: a name part, a domain separator @ and a domain part containing a dot.
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE
 
Constructor Summary
DefaultInternetAddressConverter()
          Constructs a new converter.
 
Method Summary
protected  Object getComponentInstance(String className, Object object, String pattern, Object minValue, Object maxValue)
          Gets an instance of the named component class by converting the source object and optionally applying the specified pattern and limits.
 Object getInstance(String className, Object object, String pattern, Object minValue, Object maxValue)
          Gets an instance of the named class by converting the source object and optionally applying the specified pattern and limits.
 boolean isConversionSupported(String className)
          Checks whether conversion of the specified class is supported.
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)
          Returns a string representation of an object of the named class by optionally applying the specified pattern.
 
Methods inherited from class org.norther.tammi.core.converter.DefaultObjectConverter
fromLocalizedObject, getFormatPattern, 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
 

Field Detail

INTERNET_ADDRESS_TYPE

public static final String INTERNET_ADDRESS_TYPE
An internet address type.


LOOSE_SYNTAX

public static final String LOOSE_SYNTAX
The pattern for loose syntax "!" ignores the syntax of the address address formed by three parts: a name part, a domain separator @ and a domain part containing a dot.

Examples: name@xxxxx.yy firstname.lastname@xxxxx.yyyy.zzz

See Also:
Constant Field Values

ADDR_PATTERN

public static final String ADDR_PATTERN
The pattern for plain address "A" specifies address being used as such and not converted to a RFC822/RFC2047 encoded mail-safe address.

Examples: Without plain address pattern an address Mika Häkkinen<mika.hakkinen@xxxxx.yy> will be converted to: "Mika Häkkinen" <mika.hakkinen@xxxxx.yy>. If the pattern is specified the same address is converted to: <mika.hakkinen@xxxxx.yy>.

See Also:
Constant Field Values
Constructor Detail

DefaultInternetAddressConverter

public DefaultInternetAddressConverter()
Constructs a new converter.

Method Detail

isConversionSupported

public boolean isConversionSupported(String className)
Description copied from interface: ObjectConverter
Checks whether conversion of the specified class is supported.

Specified by:
isConversionSupported in interface ObjectConverter
Overrides:
isConversionSupported in class DefaultObjectConverter
Parameters:
className - the class name.
Returns:
true for a supported conversion, false otherwise.

getInstance

public Object getInstance(String className,
                          Object object,
                          String pattern,
                          Object minValue,
                          Object maxValue)
                   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 and limits.

Specified by:
getInstance in interface ObjectConverter
Overrides:
getInstance in class DefaultObjectConverter
Parameters:
className - the name of the class.
object - the source object.
pattern - an optional conversion pattern.
minValue - an optional minimum value.
maxValue - an optional maximum value.
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
Overrides:
toString in class DefaultObjectConverter
Parameters:
className - the name of the class.
object - the source object.
pattern - an optional conversion pattern.
Returns:
the string representation.

getComponentInstance

protected Object getComponentInstance(String className,
                                      Object object,
                                      String pattern,
                                      Object minValue,
                                      Object maxValue)
                               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 and limits.

Overrides:
getComponentInstance in class DefaultObjectConverter
Parameters:
className - the name of the class.
object - the source object.
pattern - an optional conversion pattern.
minValue - an optional minimum value.
maxValue - an optional maximum value.
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
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.