001    /****************************************************************
002     * Licensed to the Apache Software Foundation (ASF) under one   *
003     * or more contributor license agreements.  See the NOTICE file *
004     * distributed with this work for additional information        *
005     * regarding copyright ownership.  The ASF licenses this file   *
006     * to you under the Apache License, Version 2.0 (the            *
007     * "License"); you may not use this file except in compliance   *
008     * with the License.  You may obtain a copy of the License at   *
009     *                                                              *
010     *   http://www.apache.org/licenses/LICENSE-2.0                 *
011     *                                                              *
012     * Unless required by applicable law or agreed to in writing,   *
013     * software distributed under the License is distributed on an  *
014     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
015     * KIND, either express or implied.  See the License for the    *
016     * specific language governing permissions and limitations      *
017     * under the License.                                           *
018     ****************************************************************/
019    
020    package org.apache.james.mime4j.field;
021    
022    public class DefaultFieldParser extends DelegatingFieldParser {
023    
024        public DefaultFieldParser() {
025            setFieldParser(FieldName.CONTENT_TRANSFER_ENCODING,
026                    ContentTransferEncodingField.PARSER);
027            setFieldParser(FieldName.CONTENT_TYPE, ContentTypeField.PARSER);
028            setFieldParser(FieldName.CONTENT_DISPOSITION,
029                    ContentDispositionField.PARSER);
030    
031            final FieldParser dateTimeParser = DateTimeField.PARSER;
032            setFieldParser(FieldName.DATE, dateTimeParser);
033            setFieldParser(FieldName.RESENT_DATE, dateTimeParser);
034    
035            final FieldParser mailboxListParser = MailboxListField.PARSER;
036            setFieldParser(FieldName.FROM, mailboxListParser);
037            setFieldParser(FieldName.RESENT_FROM, mailboxListParser);
038    
039            final FieldParser mailboxParser = MailboxField.PARSER;
040            setFieldParser(FieldName.SENDER, mailboxParser);
041            setFieldParser(FieldName.RESENT_SENDER, mailboxParser);
042    
043            final FieldParser addressListParser = AddressListField.PARSER;
044            setFieldParser(FieldName.TO, addressListParser);
045            setFieldParser(FieldName.RESENT_TO, addressListParser);
046            setFieldParser(FieldName.CC, addressListParser);
047            setFieldParser(FieldName.RESENT_CC, addressListParser);
048            setFieldParser(FieldName.BCC, addressListParser);
049            setFieldParser(FieldName.RESENT_BCC, addressListParser);
050            setFieldParser(FieldName.REPLY_TO, addressListParser);
051        }
052    
053    }