Package org.apache.james.mime4j.field
Class AbstractField
- java.lang.Object
-
- org.apache.james.mime4j.field.AbstractField
-
- All Implemented Interfaces:
ParsedField
,Field
- Direct Known Subclasses:
AddressListFieldImpl
,AddressListFieldLenientImpl
,ContentDescriptionFieldImpl
,ContentDispositionFieldImpl
,ContentDispositionFieldLenientImpl
,ContentIdFieldImpl
,ContentLanguageFieldImpl
,ContentLanguageFieldLenientImpl
,ContentLengthFieldImpl
,ContentLocationFieldImpl
,ContentLocationFieldLenientImpl
,ContentMD5FieldImpl
,ContentTransferEncodingFieldImpl
,ContentTypeFieldImpl
,ContentTypeFieldLenientImpl
,DateTimeFieldImpl
,DateTimeFieldLenientImpl
,MailboxFieldImpl
,MailboxFieldLenientImpl
,MailboxListFieldImpl
,MailboxListFieldLenientImpl
,MimeVersionFieldImpl
,MimeVersionFieldLenientImpl
,UnstructuredFieldImpl
public abstract class AbstractField extends java.lang.Object implements ParsedField
The base class of all field classes.
-
-
Field Summary
Fields Modifier and Type Field Description protected DecodeMonitor
monitor
protected Field
rawField
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractField(Field rawField, DecodeMonitor monitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getBody()
Gets the unfolded, unparsed and possibly encoded (see RFC 2047) field body string.java.lang.String
getName()
Gets the name of the field (Subject
,From
, etc).java.lang.String
getNameLowerCase()
Gets the name of the field in lower case (subject
,from
, etc).ParseException
getParseException()
Returns the exception that was thrown by the field parser while parsing the field value.ByteSequence
getRaw()
Gets original (raw) representation of the field, if available,null
otherwise.protected RawField
getRawField()
boolean
isValidField()
Returnstrue
if this field is valid, i.e.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.james.mime4j.dom.field.ParsedField
bodyDescriptionField
-
-
-
-
Field Detail
-
rawField
protected final Field rawField
-
monitor
protected final DecodeMonitor monitor
-
-
Constructor Detail
-
AbstractField
protected AbstractField(Field rawField, DecodeMonitor monitor)
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the name of the field (Subject
,From
, etc).
-
getNameLowerCase
public java.lang.String getNameLowerCase()
Gets the name of the field in lower case (subject
,from
, etc).- Specified by:
getNameLowerCase
in interfaceField
- Returns:
- the field name.
-
getBody
public java.lang.String getBody()
Gets the unfolded, unparsed and possibly encoded (see RFC 2047) field body string.
-
getRaw
public ByteSequence getRaw()
Gets original (raw) representation of the field, if available,null
otherwise.
-
isValidField
public boolean isValidField()
Description copied from interface:ParsedField
Returnstrue
if this field is valid, i.e. no errors were encountered while parsing the field value.- Specified by:
isValidField
in interfaceParsedField
- Returns:
true
if this field is valid,false
otherwise.- See Also:
ParsedField.isValidField()
-
getParseException
public ParseException getParseException()
Description copied from interface:ParsedField
Returns the exception that was thrown by the field parser while parsing the field value. The result isnull
if the field is valid and no errors were encountered.- Specified by:
getParseException
in interfaceParsedField
- Returns:
- the exception that was thrown by the field parser or
null
if the field is valid. - See Also:
ParsedField.getParseException()
-
getRawField
protected RawField getRawField()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-