1 /*
2  *  Copyright 2006 the mime4j project
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  */
16 package org.apache.james.mime4j.field;
17 
18 public class DefaultFieldParser extends DelegatingFieldParser {
19 
DefaultFieldParser()20     public DefaultFieldParser() {
21         setFieldParser(Field.CONTENT_TRANSFER_ENCODING, new ContentTransferEncodingField.Parser());
22         setFieldParser(Field.CONTENT_TYPE, new ContentTypeField.Parser());
23 
24         final DateTimeField.Parser dateTimeParser = new DateTimeField.Parser();
25         setFieldParser(Field.DATE, dateTimeParser);
26         setFieldParser(Field.RESENT_DATE, dateTimeParser);
27 
28         final MailboxListField.Parser mailboxListParser = new MailboxListField.Parser();
29         setFieldParser(Field.FROM, mailboxListParser);
30         setFieldParser(Field.RESENT_FROM, mailboxListParser);
31 
32         final MailboxField.Parser mailboxParser = new MailboxField.Parser();
33         setFieldParser(Field.SENDER, mailboxParser);
34         setFieldParser(Field.RESENT_SENDER, mailboxParser);
35 
36         final AddressListField.Parser addressListParser = new AddressListField.Parser();
37         setFieldParser(Field.TO, addressListParser);
38         setFieldParser(Field.RESENT_TO, addressListParser);
39         setFieldParser(Field.CC, addressListParser);
40         setFieldParser(Field.RESENT_CC, addressListParser);
41         setFieldParser(Field.BCC, addressListParser);
42         setFieldParser(Field.RESENT_BCC, addressListParser);
43         setFieldParser(Field.REPLY_TO, addressListParser);
44     }
45 }
46