|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.james.mime4j.message.AbstractHeader
public abstract class AbstractHeader
Abstract MIME header.
| Constructor Summary | |
|---|---|
AbstractHeader()
Creates a new empty Header. |
|
AbstractHeader(Header other)
Creates a new Header from the specified
Header. |
|
| Method Summary | |
|---|---|
void |
addField(Field field)
Adds a field to the end of the list of fields. |
Field |
getField(String name)
Gets a Field given a field name. |
List<Field> |
getFields()
Gets the fields of this header. |
List<Field> |
getFields(String name)
Gets all Fields having the specified field name. |
Iterator<Field> |
iterator()
Returns an iterator over the list of fields of this header. |
int |
removeFields(String name)
Removes all Fields having the specified field name. |
void |
setField(Field field)
Sets or replaces a field. |
String |
toString()
Return Header Object as String representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractHeader()
Header.
public AbstractHeader(Header other)
Header from the specified
Header. The Header instance is initialized
with a copy of the list of Fields of the specified
Header. The Field objects are not copied
because they are immutable and can safely be shared between headers.
other - header to copy.| Method Detail |
|---|
public void addField(Field field)
addField in interface Headerfield - the field to add.public List<Field> getFields()
getFields in interface HeaderField objects.public Field getField(String name)
Field given a field name. If there are multiple
such fields defined in this header the first one will be returned.
getField in interface Headername - the field name (e.g. From, Subject).
null if none found.public List<Field> getFields(String name)
Fields having the specified field name.
getFields in interface Headername - the field name (e.g. From, Subject).
public Iterator<Field> iterator()
iterator in interface Iterable<Field>iterator in interface Headerpublic int removeFields(String name)
Fields having the specified field name.
removeFields in interface Headername - the field name (e.g. From, Subject).
public void setField(Field field)
Header does not already contain a header field of
the same name as the given field then it is added to the end of the list
of fields (same behavior as addField(Field)). Otherwise the
first occurrence of a field with the same name is replaced by the given
field and all further occurrences are removed.
setField in interface Headerfield - the field to set.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||