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.parser;
021    
022    /**
023     * Enumeration of states an entity is expected to go through
024     * in the process of the MIME stream parsing.
025     */
026    public interface EntityStates {
027    
028        /**
029         * This token indicates, that the MIME stream has been completely
030         * and successfully parsed, and no more data is available.
031         */
032        int T_END_OF_STREAM = -1;
033        /**
034         * This token indicates, that the MIME stream is currently
035         * at the beginning of a message.
036         */
037        int T_START_MESSAGE = 0;
038        /**
039         * This token indicates, that the MIME stream is currently
040         * at the end of a message.
041         */
042        int T_END_MESSAGE = 1;
043        /**
044         * This token indicates, that a raw entity is currently being processed.
045         */
046        int T_RAW_ENTITY = 2;
047        /**
048         * This token indicates, that a message parts headers are now
049         * being parsed.
050         */
051        int T_START_HEADER = 3;
052        /**
053         * This token indicates, that a message parts field has now
054         * been parsed. 
055         */
056        int T_FIELD = 4;
057        /**
058         * This token indicates, that part headers have now been
059         * parsed.
060         */
061        int T_END_HEADER = 5;
062        /**
063         * This token indicates, that a multipart body is being parsed.
064         */
065        int T_START_MULTIPART = 6;
066        /**
067         * This token indicates, that a multipart body has been parsed.
068         */
069        int T_END_MULTIPART = 7;
070        /**
071         * This token indicates, that a multiparts preamble is being
072         * parsed. 
073         */
074        int T_PREAMBLE = 8;
075        /**
076         * This token indicates, that a multiparts epilogue is being
077         * parsed. 
078         */
079        int T_EPILOGUE = 9;
080        /**
081         * This token indicates, that the MIME stream is currently
082         * at the beginning of a body part.
083         */
084        int T_START_BODYPART = 10;
085        /**
086         * This token indicates, that the MIME stream is currently
087         * at the end of a body part.
088         */
089        int T_END_BODYPART = 11;
090        /**
091         * This token indicates, that an atomic entity is being parsed.
092         */
093        int T_BODY = 12;
094    
095    }