com.hunnysoft.jmime
Class Address

java.lang.Object
  extended bycom.hunnysoft.jmime.Node
      extended bycom.hunnysoft.jmime.FieldBody
          extended bycom.hunnysoft.jmime.Address
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
Group, Mailbox

public abstract class Address
extends FieldBody

Abstract class that represents an RFC 2822 mail address.

Address represents a mail address as described in RFC 2822. You may not create instances of Address, since Address is an abstract base class. Instead, you must create instances of Mailbox or Group, which are subclasses of Address.

If the string representation assigned to an Address is improperly formed, then the parse method will fail. To determine if the parse method failed, call the isValid() method.


Field Summary
protected  boolean mIsValid
           
 
Fields inherited from class com.hunnysoft.jmime.FieldBody
mText
 
Fields inherited from class com.hunnysoft.jmime.Node
mIsModified, mParent, mString
 
Constructor Summary
protected Address()
          Default constructor.
protected Address(Address other)
          Copy constructor.
protected Address(ByteString bstr)
          Constructor that takes an initial byte string argument.
 
Method Summary
 boolean isValid()
          Indicates if the address's syntax is valid.
 
Methods inherited from class com.hunnysoft.jmime.FieldBody
assemble, clone, fold, isFoldingEnabled, maybeFold, parse, setFoldingEnabled, setText, text, unfold
 
Methods inherited from class com.hunnysoft.jmime.Node
_setString, isModified, parent, setModified, setParent, setString, string, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mIsValid

protected boolean mIsValid
Constructor Detail

Address

protected Address()
Default constructor.

This constructor sets the Address object's string representation to the empty string and sets its parent node to null.


Address

protected Address(Address other)
Copy constructor.

This constructor performs a deep copy of its argument. The parent node of the new Address object is set to null.

Parameters:
other - Address instance to copy

Address

protected Address(ByteString bstr)
Constructor that takes an initial byte string argument.

This constructor sets the Address object's string representation to bstr and sets its parent node to null.

Normally, you call the parse() method immediately after this constructor to create the broken-down representation.

Parameters:
bstr - initial value for the string representation
Method Detail

isValid

public final boolean isValid()
Indicates if the address's syntax is valid.

Returns true value if the last parse operation succeeded. Returns false if the last parse operation failed (bad address) or if the parse() method was never called.

Returns:
boolean value that indicates if the last parse operation succeeded