|
Apache JAMES Mime4j 0.6-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.james.mime4j.field.AbstractField
public abstract class AbstractField
The base class of all field classes.
Constructor Summary | |
---|---|
protected |
AbstractField(String name,
String body,
ByteSequence raw)
|
Method Summary | |
---|---|
String |
getBody()
Gets the unfolded, unparsed and possibly encoded (see RFC 2047) field body string. |
String |
getName()
Gets the name of the field ( Subject ,
From , etc). |
ParseException |
getParseException()
Returns the exception that was thrown by the field parser while parsing the field value. |
static DefaultFieldParser |
getParser()
Gets the default parser used to parse fields. |
ByteSequence |
getRaw()
Gets the original raw field string. |
boolean |
isValidField()
Returns true if this field is valid, i.e. |
static ParsedField |
parse(ByteSequence raw)
Parses the given byte sequence and returns an instance of the Field class. |
static ParsedField |
parse(String rawStr)
Parses the given string and returns an instance of the Field class. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected AbstractField(String name, String body, ByteSequence raw)
Method Detail |
---|
public static ParsedField parse(ByteSequence raw) throws MimeException
Field
class. The type of the class returned depends on the
field name; see parse(String)
for a table of field names and
their corresponding classes.
raw
- the bytes to parse.
ParsedField
instance.
MimeException
- if the raw string cannot be split into field name and body.isValidField()
public static ParsedField parse(String rawStr) throws MimeException
Field
class. The type of the class returned depends on
the field name:
Class returned | Field names |
---|---|
ContentTypeField | Content-Type |
ContentTransferEncodingField | Content-Transfer-Encoding |
ContentDispositionField | Content-Disposition |
DateTimeField | Date, Resent-Date |
MailboxField | Sender, Resent-Sender |
MailboxListField | From, Resent-From |
AddressListField | To, Cc, Bcc, Reply-To, Resent-To, Resent-Cc, Resent-Bcc |
UnstructuredField | Subject and others |
rawStr
- the string to parse.
ParsedField
instance.
MimeException
- if the raw string cannot be split into field name and body.isValidField()
public static DefaultFieldParser getParser()
public String getName()
Subject
,
From
, etc).
getName
in interface Field
public ByteSequence getRaw()
getRaw
in interface Field
public String getBody()
getBody
in interface Field
public boolean isValidField()
ParsedField
true
if this field is valid, i.e. no errors were
encountered while parsing the field value.
isValidField
in interface ParsedField
true
if this field is valid, false
otherwise.ParsedField.isValidField()
public ParseException getParseException()
ParsedField
null
if the field is valid
and no errors were encountered.
getParseException
in interface ParsedField
null
if the field is valid.ParsedField.getParseException()
public String toString()
toString
in class Object
|
Apache JAMES Mime4j 0.6-redhat-2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |