|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.hunnysoft.jmime.Node
com.hunnysoft.jmime.FieldBody
com.hunnysoft.jmime.MsgId
public class MsgId
Class that represents an RFC 2822 message ID.
MsgId represents a message ID as described
in RFC 2822. A
message ID appears as the field body of the "Message-ID" header field,
and has a local part and a domain separated by an
"at" sign. The following is an example of a "Message-ID" header field:
Message-ID: <994590483.5890@somehost.net>
In the above example, the local part is "994590483.5890" and the domain is "somehost.net". In MIME body parts, a message ID can also appear as the field body of the "Content-ID" header field.
In Hunny JMIME, a MsgId contains strings that contain
the local part and the domain.
In the document tree representation of message, a MsgId
object may only be a leaf node, having a parent but no child nodes.
MsgId has methods for getting or setting its local part
and its domain. You may have the library to create the contents of a
MsgId object for you by calling the methods createLocalPart() and createDomain(). You can set the default
domain by calling the static method setDefaultDomain(String).
| Field Summary |
|---|
| Fields inherited from class com.hunnysoft.jmime.FieldBody |
|---|
mText |
| Fields inherited from class com.hunnysoft.jmime.Node |
|---|
mIsModified, mParent, mString |
| Constructor Summary | |
|---|---|
MsgId()
Default constructor. |
|
MsgId(ByteString bstr)
Constructor that takes an initial byte string argument. |
|
MsgId(MsgId other)
Copy constructor. |
|
| Method Summary | |
|---|---|
void |
assemble()
Assembles the string representation. |
java.lang.Object |
clone()
Creates a copy of this object. |
void |
createDefault()
Creates the local part and domain. |
void |
createDomain()
Creates the domain. |
void |
createLocalPart()
Creates the local part. |
java.lang.String |
domain()
Gets the domain. |
java.lang.String |
localPart()
Gets the local part. |
void |
parse()
Parses the string representation. |
static void |
setDefaultDomain(java.lang.String domain)
Sets the default domain. |
void |
setDomain(java.lang.String domain)
Sets the domain. |
void |
setLocalPart(java.lang.String localPart)
Sets the local part. |
| Methods inherited from class com.hunnysoft.jmime.FieldBody |
|---|
fold, isFoldingEnabled, maybeFold, 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 |
| Constructor Detail |
|---|
public MsgId()
This constructor sets the MsgId object's string
representation to the empty string and sets its parent node to
null.
public MsgId(MsgId other)
This constructor performs a deep copy of its argument. The
parent node of the new MsgId object is set to
null.
other - MsgId instance to copypublic MsgId(ByteString bstr)
This constructor sets the MsgId 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.
bstr - initial value for the string representation| Method Detail |
|---|
public java.lang.Object clone()
This method, inherited from Object, creates a new
MsgId object that has the same value as this
MsgId object. The parent node of the new
MsgId object is set to null.
clone in class FieldBodypublic void parse()
This method, inherited from Node, executes the parse
operation for MsgId objects. The parse method creates
or updates the broken-down representation from the string
representation. For MsgId objects, the parse method
parses the string representation to extract the local part and
domain attributes.
You should call this method after you set or modify the string representation, and before you retrieve the local part or domain.
This method clears the is-modified flag.
parse in class FieldBodyNode.assemble()public void assemble()
This method, inherited from Node, executes the assemble
operation for MsgId objects. The assemble method
creates or updates the string representation from the broken-down
representation. For MsgId objects, the assemble method
builds the string representation from the local part and
domain.
You should call this method after you set or modify the local
part or domain of this MsgId object, and before you
retrieve the string representation.
This method clears the is-modified flag.
assemble in class FieldBodyNode.parse()public java.lang.String localPart()
public void setLocalPart(java.lang.String localPart)
localPart - local partpublic java.lang.String domain()
public void setDomain(java.lang.String domain)
domain - domainpublic void createDefault()
This convenience method calls createLocalPart(), createDomain(), and assemble().
public void createLocalPart()
The created local part is unique to the local machine. The method creates the local part using the current time and a thread-synchronized counter.
public void createDomain()
If a default domain is set, then that domain is used. Otherwise, this method queries the operating system to get the fully-qualified domain name.
setDefaultDomain(java.lang.String)public static void setDefaultDomain(java.lang.String domain)
The method createDomain() uses the value set by this
static method. If you set the value to null, then
createDomain() queries the operating system for the
fully-qualified domain name.
createDomain()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||