|
|||||||||
| 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.Field
Class that represents a header field.
Field represents a header field as described in RFC 2822.
According to RFC 2822, a header field contains a field name and a
field body. In Hunny JMIME, a Field contains two elements:
a String that contains its field name and a FieldBody object that represents its field body.
In the document tree representation of a message, a Field
object is always an intermediate node, having a parent node and a single
child node. The parent node is the Headers object that contains
it. The child node is the FieldBody object it
contains.
To get or set the field name, use the methods fieldName()
and setFieldName(String). To get or set the contained
FieldBody object, use fieldBody() and setFieldBody(FieldBody).
| Field Summary |
| Fields inherited from class com.hunnysoft.jmime.Node |
mIsModified, mParent, mString |
| Constructor Summary | |
Field()
Default constructor. |
|
Field(ByteString bstr)
Constructor that takes an initial byte string argument. |
|
Field(Field other)
Copy constructor. |
|
| Method Summary | |
void |
assemble()
Assembles the string representation. |
java.lang.Object |
clone()
Creates a copy of this object. |
FieldBody |
fieldBody()
Gets the field body. |
java.lang.String |
fieldName()
Gets the field name. |
static FieldBodyFactory |
getFieldBodyFactory()
Gets the FieldBodyFactory instance. |
void |
parse()
Parses the string representation. |
void |
setFieldBody(FieldBody fieldBody)
Sets the field body. |
static void |
setFieldBodyFactory(FieldBodyFactory factory)
Sets the FieldBodyFactory instance. |
void |
setFieldName(java.lang.String name)
Sets the field name. |
| 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 Field()
This constructor sets the Field object's string
representation to the empty string and sets its parent node to
null.
public Field(Field other)
This constructor performs a deep copy of its argument. The
parent node of the new Field object is set to
null.
other - Field instance to copypublic Field(ByteString bstr)
This constructor sets the Field 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
Field object that has the same value as this
Field object. The parent node of the new
Field object is set to null.
clone in class Nodepublic void parse()
This method, inherited from Node, executes the
parse operation for Field objects. The parse operation
creates or updates the broken-down representation from the string
representation. For Field objects, the parse operation
updates the value of the field name string and creates an instance
of the appropriate subclass of FieldBody. This method
also calls the parse() method of the
FieldBody object it creates.
You should call this method after you set or modify the string representation, and before you access the field name or field 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 Field objects. The assemble
operation creates or updates the string representation from the
broken-down representation. For Field objects, the
assemble operation builds the string representation from the field
name and the string representation of the contained
FieldBody object. Before it builds the string
representation, this method calls the assemble() method
of its contained FieldBody object.
You should call this method after you set or modify either the
field name or the contained FieldBody object, and
before you retrieve the string representation.
This method clears the is-modified flag.
assemble in class NodeNode.parse()public final java.lang.String fieldName()
public final void setFieldName(java.lang.String name)
name - field namepublic final FieldBody fieldBody()
public final void setFieldBody(FieldBody fieldBody)
fieldBody - field body objectpublic static FieldBodyFactory getFieldBodyFactory()
FieldBodyFactory instance.
The library uses a single FieldBodyFactory instance
to create new FieldBody objects. Developers may create
subclasses of library classes. The library uses the factory
installed by the developer to create instances of these
subclasses.
FieldBodyFactory instancepublic static void setFieldBodyFactory(FieldBodyFactory factory)
FieldBodyFactory instance.
The library uses a single FieldBodyFactory instance
to create new FieldBody objects. Developers may create
subclasses of library classes. The library uses the factory
installed by the developer to create instances of these
subclasses.
factory - the FieldBodyFactory instance
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||