|
|||||||||
| 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.Entity
Abstract class that represents a MIME entity.
RFC 2045
defines an entity as either a message or a
body part, both of which have a collection of header fields
and a body. In Hunny JMIME, an entity is represented by the
class Entity, which contains both a Headers
object and a Body object.
In the document tree representation of message, an
Entity object may be either a root node, having child nodes
but no parent node, or an intermediate node, having both a parent node
and child nodes. An Entity object that is a root node
should be a Message object. An Entity object that
is an intermediate node should be a BodyPart object, and its
parent should be a Body object. The child nodes of an
Entity object are the Headers and
Body objects it contains. (See the documentation for
Node for a discussion of the tree representation of a
message.)
Since Entity is an abstract base class, you cannot
create instances of it directly. Entity has two derived
classes, Message and BodyPart, which are
concrete classes.
To access the contained Headers object, call the headers() method. To access the contained Body object,
call the body() method.
| Field Summary |
| Fields inherited from class com.hunnysoft.jmime.Node |
mIsModified, mParent, mString |
| Constructor Summary | |
protected |
Entity()
Default constructor. |
protected |
Entity(ByteString bstr)
Constructor that takes an initial byte string argument. |
|
Entity(Entity other)
Copy constructor. |
| Method Summary | |
void |
assemble()
Assembles the string representation. |
Body |
body()
Gets the contained body. |
Headers |
headers()
Gets the contained header fields. |
void |
parse()
Parses the string representation. |
void |
setBody(Body body)
Sets the contained body. |
void |
setHeaders(Headers headers)
Sets the contained header fields. |
| Methods inherited from class com.hunnysoft.jmime.Node |
_setString, clone, 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 |
protected Entity()
This constructor sets the Entity object's string
representation to the empty string and sets its parent node to
null.
public Entity(Entity other)
This constructor performs a deep copy of its argument. The
parent node of the new Entity object is set to
null.
other - Entity instance to copyprotected Entity(ByteString bstr)
This constructor sets the Entity 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 void parse()
This method, inherited from Node, executes the
parse operation for Entity objects. The parse
operation creates or updates the broken-down representation from the
string representation. For Entity objects, the parse
method parses the string representation and sets the values of the
Headers and Body objects it contains.
This method also calls the parse() methods of the
contained Headers and Body objects.
You should call this method after you set or modify the string representation, and before you access either the contained headers or body.
This method clears the is-modified flag.
parse in class NodeNode.assemble()public void assemble()
This method, inherited from Node, executes the
assemble operation for Entity objects. The assemble
operation creates or updates the string representation from the
broken-down representation. For Entity objects, the
assemble method builds the string representation from the string
representations of the contained Headers and
Body objects. This method calls the
assemble() methods of its Headers and
Body objects.
You should call this method after you modify either the contained headers or body, and before you retrieve the string representation.
This method clears the is-modified flag.
assemble in class NodeNode.parse()public Headers headers()
public void setHeaders(Headers headers)
public Body body()
public void setBody(Body body)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||