dom/src/main/java/org/apache/james/mime4j/field/DefaultFieldParser.java [60:120]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public static FieldParser<ParsedField> getParser() {
        return PARSER;
    }

    /**
     * Parses the given byte sequence and returns an instance of the {@link ParsedField} class. 
     * The type of the class returned depends on the field name; see {@link #parse(String)} for 
     * a table of field names and their corresponding classes.
     *
     * @param raw the bytes to parse.
     * @param monitor decoding monitor used while parsing/decoding.
     * @return a parsed field.
     * @throws MimeException if the raw string cannot be split into field name and body.
     */
    public static ParsedField parse(
            final ByteSequence raw,
            final DecodeMonitor monitor) throws MimeException {
        Field rawField = RawFieldParser.DEFAULT.parseField(raw);
        return PARSER.parse(rawField, monitor);
    }

    /**
     * <p>
     * Parses the given string and returns an instance of the {@link ParsedField} class. 
     * The type of the class returned depends on the field name:
     * </p>
     * <table summary="Field names and corresponding classes">
     *   <tr><th>Class returned</th><th>Field names</th></tr>
     *   <tr><td>{@link ContentTypeField}</td><td>Content-Type</td></tr>
     *   <tr><td>{@link ContentLengthField}</td><td>Content-Length</td></tr>
     *   <tr><td>{@link ContentTransferEncodingField}</td><td>Content-Transfer-Encoding</td></tr>
     *   <tr><td>{@link ContentDispositionField}</td><td>Content-Disposition</td></tr>
     *   <tr><td>{@link ContentDescriptionField}</td><td>Content-Description</td></tr>
     *   <tr><td>{@link ContentIdField}</td><td>Content-ID</td></tr>
     *   <tr><td>{@link ContentMD5Field}</td><td>Content-MD5</td></tr>
     *   <tr><td>{@link ContentLanguageField}</td><td>Content-Language</td></tr>
     *   <tr><td>{@link ContentLocationField}</td><td>Content-Location</td></tr>
     *   <tr><td>{@link MimeVersionField}</td><td>MIME-Version</td></tr>
     *   <tr><td>{@link DateTimeField}</td><td>Date, Resent-Date</td></tr>
     *   <tr><td>{@link MailboxField}</td><td>Sender, Resent-Sender</td></tr>
     *   <tr><td>{@link MailboxListField}</td><td>From, Resent-From</td></tr>
     *   <tr><td>{@link AddressListField}</td><td>To, Cc, Bcc, Reply-To, Resent-To, Resent-Cc, Resent-Bcc</td></tr>
     *   <tr><td>{@link UnstructuredField}</td><td>Subject and others</td></tr>
     * </table>
     *
     * @param rawStr the string to parse.
     * @return a parsed field.
     * @throws MimeException if the raw string cannot be split into field name and body.
     */
    public static ParsedField parse(
            final String rawStr,
            final DecodeMonitor monitor) throws MimeException {
        ByteSequence raw = ContentUtil.encode(rawStr);
        RawField rawField = RawFieldParser.DEFAULT.parseField(raw);
        // Do not retain the original raw representation as the field
        // may require folding
        return PARSER.parse(rawField, monitor);
    }

    public static ParsedField parse(final String rawStr) throws MimeException {
        return parse(rawStr, DecodeMonitor.SILENT);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



dom/src/main/java/org/apache/james/mime4j/field/LenientFieldParser.java [61:130]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public static FieldParser<ParsedField> getParser() {
        return PARSER;
    }

    /**
     * Parses the given byte sequence and returns an instance of the {@link ParsedField} class. 
     * The type of the class returned depends on the field name; see {@link #parse(String)} for 
     * a table of field names and their corresponding classes.
     *
     * @param raw the bytes to parse.
     * @param monitor decoding monitor used while parsing/decoding.
     * @return a parsed field.
     * @throws MimeException if the raw string cannot be split into field name and body.
     */
    public static ParsedField parse(
            final ByteSequence raw,
            final DecodeMonitor monitor) throws MimeException {
        Field rawField = RawFieldParser.DEFAULT.parseField(raw);
        return PARSER.parse(rawField, monitor);
    }

    /**
     * Parses the given string and returns an instance of the <code>Field</code> class.
     * The type of the class returned depends on the field name.
     *
     * @param rawStr the string to parse.
     * @param monitor a DecodeMonitor object used while parsing/decoding.
     * @return a <code>ParsedField</code> instance.
     * @throws MimeException if the raw string cannot be split into field name and body.
     */
    public static ParsedField parse(
            final String rawStr,
            final DecodeMonitor monitor) throws MimeException {
        ByteSequence raw = ContentUtil.encode(rawStr);
        RawField rawField = RawFieldParser.DEFAULT.parseField(raw);
        // Do not retain the original raw representation as the field
        // may require folding
        return PARSER.parse(rawField, monitor);
    }

    /**
     * <p>
     * Parses the given string and returns an instance of the {@link ParsedField} class. 
     * The type of the class returned depends on the field name:
     * </p>
     * <table summary="Field names and corresponding classes">
     *   <tr><th>Class returned</th><th>Field names</th></tr>
     *   <tr><td>{@link ContentTypeField}</td><td>Content-Type</td></tr>
     *   <tr><td>{@link ContentLengthField}</td><td>Content-Length</td></tr>
     *   <tr><td>{@link ContentTransferEncodingField}</td><td>Content-Transfer-Encoding</td></tr>
     *   <tr><td>{@link ContentDispositionField}</td><td>Content-Disposition</td></tr>
     *   <tr><td>{@link ContentDescriptionField}</td><td>Content-Description</td></tr>
     *   <tr><td>{@link ContentIdField}</td><td>Content-ID</td></tr>
     *   <tr><td>{@link ContentMD5Field}</td><td>Content-MD5</td></tr>
     *   <tr><td>{@link ContentLanguageField}</td><td>Content-Language</td></tr>
     *   <tr><td>{@link ContentLocationField}</td><td>Content-Location</td></tr>
     *   <tr><td>{@link MimeVersionField}</td><td>MIME-Version</td></tr>
     *   <tr><td>{@link DateTimeField}</td><td>Date, Resent-Date</td></tr>
     *   <tr><td>{@link MailboxField}</td><td>Sender, Resent-Sender</td></tr>
     *   <tr><td>{@link MailboxListField}</td><td>From, Resent-From</td></tr>
     *   <tr><td>{@link AddressListField}</td><td>To, Cc, Bcc, Reply-To, Resent-To, Resent-Cc, Resent-Bcc</td></tr>
     *   <tr><td>{@link UnstructuredField}</td><td>Subject and others</td></tr>
     * </table>
     *
     * @param rawStr the string to parse.
     * @return a parsed field.
     * @throws MimeException if the raw string cannot be split into field name and body.
     */
    public static ParsedField parse(final String rawStr) throws MimeException {
        return parse(rawStr, DecodeMonitor.SILENT);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



