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.stream;
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 enum EntityState {
027        /**
028         * This token indicates, that the MIME stream is currently
029         * at the beginning of a message.
030         */
031        T_START_MESSAGE,
032        /**
033         * This token indicates, that the MIME stream is currently
034         * at the end of a message.
035         */
036        T_END_MESSAGE,
037        /**
038         * This token indicates, that a raw entity is currently being processed.
039         */
040        T_RAW_ENTITY,
041        /**
042         * This token indicates, that a message parts headers are now
043         * being parsed.
044         */
045        T_START_HEADER,
046        /**
047         * This token indicates, that a message parts field has now
048         * been parsed.
049         */
050        T_FIELD,
051        /**
052         * This token indicates, that part headers have now been
053         * parsed.
054         */
055        T_END_HEADER,
056        /**
057         * This token indicates, that a multipart body is being parsed.
058         */
059        T_START_MULTIPART,
060        /**
061         * This token indicates, that a multipart body has been parsed.
062         */
063        T_END_MULTIPART,
064        /**
065         * This token indicates, that a multiparts preamble is being
066         * parsed.
067         */
068        T_PREAMBLE,
069        /**
070         * This token indicates, that a multiparts epilogue is being
071         * parsed.
072         */
073        T_EPILOGUE,
074        /**
075         * This token indicates, that the MIME stream is currently
076         * at the beginning of a body part.
077         */
078        T_START_BODYPART,
079        /**
080         * This token indicates, that the MIME stream is currently
081         * at the end of a body part.
082         */
083        T_END_BODYPART,
084        /**
085         * This token indicates, that an atomic entity is being parsed.
086         */
087        T_BODY,
088        /**
089         * This token indicates, that the MIME stream has been completely
090         * and successfully parsed, and no more data is available.
091         */
092        T_END_OF_STREAM
093    
094    }