Package adams.core.net
Class EmailAddress
- java.lang.Object
-
- adams.core.base.BaseObject
-
- adams.core.base.AbstractBaseString
-
- adams.core.net.EmailAddress
-
- All Implemented Interfaces:
CloneHandler<BaseObject>
,Serializable
,Comparable
public class EmailAddress extends AbstractBaseString
Wrapper for a regular expression string to be editable in the GOE. Basically the same as BaseString, but checks whether the string represents a valid address usingjavax.mail.internet.InternetAddress
.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
DUMMY_ADDRESS
the dummy address.-
Fields inherited from class adams.core.base.BaseObject
m_Internal, m_Properties, SUFFIX_DISPLAY, SUFFIX_VALUE
-
-
Constructor Summary
Constructors Constructor Description EmailAddress()
Initializes the email address with a dummy one.EmailAddress(String s)
Initializes the object with the string to parse.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).boolean
hasFavoritesSupport()
Whether this object should have favorites support.protected void
initialize()
Initializes the internal object.boolean
isDummyAddress()
Returns whether the address is just the dummy address.boolean
isValid(String value)
Checks whether the string value is a valid presentation for this class.String
strippedValue()
Returns the actual email address from the email string.-
Methods inherited from class adams.core.base.AbstractBaseString
convert, getValue, isEmpty, length, setValue, stringValue
-
Methods inherited from class adams.core.base.BaseObject
compareTo, equals, getClone, getInternal, getTemplates, getUnicode, hashCode, isValidUnicode, newInstance, setUnicode, toObjectArray, toObjectArray, toString, toStringArray, toStringList
-
-
-
-
Field Detail
-
DUMMY_ADDRESS
public static final String DUMMY_ADDRESS
the dummy address.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EmailAddress
public EmailAddress()
Initializes the email address with a dummy one.
-
EmailAddress
public EmailAddress(String s)
Initializes the object with the string to parse.- Parameters:
s
- the string to parse
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the internal object.- Overrides:
initialize
in classAbstractBaseString
-
isValid
public boolean isValid(String value)
Checks whether the string value is a valid presentation for this class.- Overrides:
isValid
in classAbstractBaseString
- Parameters:
value
- the string value to check- Returns:
- true if valid email address
- See Also:
InternetAddress
-
isDummyAddress
public boolean isDummyAddress()
Returns whether the address is just the dummy address.- Returns:
- the dummy address
-
getTipText
public String getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).- Specified by:
getTipText
in classAbstractBaseString
- Returns:
- the tool tip
-
strippedValue
public String strippedValue()
Returns the actual email address from the email string.- Returns:
- the actual address
-
hasFavoritesSupport
public boolean hasFavoritesSupport()
Whether this object should have favorites support.- Overrides:
hasFavoritesSupport
in classBaseObject
- Returns:
- true if to support favorites
-
-