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<javax.mail.internet.InternetAddress>
          extended by org.norther.tammi.core.mail.DefaultInternetAddressConverter
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Manageable, MBeanDelegate, ObjectConverter<javax.mail.internet.InternetAddress>

public class DefaultInternetAddressConverter
extends DefaultObjectConverter<javax.mail.internet.InternetAddress>

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

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

Version:
$Id: DefaultInternetAddressConverter.java,v 1.11 2009/09/28 15:08:45 cvsimp Exp $
Author:
Ilkka Priha
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
 
Constructor Summary
DefaultInternetAddressConverter()
          Constructs a new converter.
 
Method Summary
protected  javax.mail.internet.InternetAddress 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.
 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.
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

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<javax.mail.internet.InternetAddress>
Overrides:
getInstance in class DefaultObjectConverter<javax.mail.internet.InternetAddress>
Parameters:
className - the name of the class.
object - the source object.
pattern - an optional conversion pattern.
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<javax.mail.internet.InternetAddress>
Overrides:
toString in class DefaultObjectConverter<javax.mail.internet.InternetAddress>
Parameters:
className - the name of the class.
object - the source object.
pattern - an optional conversion pattern.
Returns:
the string representation.

getComponentInstance

protected javax.mail.internet.InternetAddress 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<javax.mail.internet.InternetAddress>
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<javax.mail.internet.InternetAddress>
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.