Class LenientFieldParser
java.lang.Object
org.apache.james.mime4j.field.DelegatingFieldParser
org.apache.james.mime4j.field.LenientFieldParser
- All Implemented Interfaces:
FieldParser<ParsedField>
Lenient implementation of the
FieldParser interface with a high degree of tolerance
to non-severe MIME field format violations.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FieldParser<ParsedField> Gets the default instance of this class.static ParsedFieldParses the given string and returns an instance of theParsedFieldclass.static ParsedFieldparse(String rawStr, DecodeMonitor monitor) Parses the given string and returns an instance of theFieldclass.static ParsedFieldparse(ByteSequence raw, DecodeMonitor monitor) Parses the given byte sequence and returns an instance of theParsedFieldclass.Methods inherited from class DelegatingFieldParser
getParser, parse, setFieldParser
-
Field Details
-
PARSER
-
-
Constructor Details
-
LenientFieldParser
public LenientFieldParser()
-
-
Method Details
-
getParser
Gets the default instance of this class.- Returns:
- the default instance
-
parse
Parses the given byte sequence and returns an instance of theParsedFieldclass. The type of the class returned depends on the field name; seeparse(String)for a table of field names and their corresponding classes.- Parameters:
raw- the bytes to parse.monitor- decoding monitor used while parsing/decoding.- Returns:
- a parsed field.
- Throws:
MimeException- if the raw string cannot be split into field name and body.
-
parse
Parses the given string and returns an instance of theFieldclass. The type of the class returned depends on the field name.- Parameters:
rawStr- the string to parse.monitor- a DecodeMonitor object used while parsing/decoding.- Returns:
- a
ParsedFieldinstance. - Throws:
MimeException- if the raw string cannot be split into field name and body.
-
parse
Parses the given string and returns an instance of the
ParsedFieldclass. The type of the class returned depends on the field name:Class returned Field names ContentTypeFieldContent-Type ContentLengthFieldContent-Length ContentTransferEncodingFieldContent-Transfer-Encoding ContentDispositionFieldContent-Disposition ContentDescriptionFieldContent-Description ContentIdFieldContent-ID ContentMD5FieldContent-MD5 ContentLanguageFieldContent-Language ContentLocationFieldContent-Location MimeVersionFieldMIME-Version DateTimeFieldDate, Resent-Date MailboxFieldSender, Resent-Sender MailboxListFieldFrom, Resent-From AddressListFieldTo, Cc, Bcc, Reply-To, Resent-To, Resent-Cc, Resent-Bcc UnstructuredFieldSubject and others - Parameters:
rawStr- the string to parse.- Returns:
- a parsed field.
- Throws:
MimeException- if the raw string cannot be split into field name and body.
-