Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.james.mime4j.parser
Interface EntityStateMachine

All Known Implementing Classes:
  AbstractEntity, MimeEntity, RawEntity

    public interface EntityStateMachine

Represents the interal state of a MIME entity, which is being retrieved from an input stream by a MIME parser.

Method Summary
`EntityStateMachine` | `advance()` Advances the state machine to the next state in the process of the MIME stream parsing.
`BodyDescriptor` | `getBodyDescriptor()` Returns description of the entity body.
`java.io.InputStream` | `getContentStream()` Returns content stream of the entity body.
`java.lang.String` | `getField()` Returns current header field.
`java.lang.String` | `getFieldName()` Returns name of the current header field.
`java.lang.String` | `getFieldValue()` Returns value of the current header field.
`int` | `getState()` Return the current state of the entity.
`void` | `setRecursionMode(int recursionMode)` Sets the current recursion mode.

Method Detail

### getState

    int getState()

  Return the current state of the entity.

  Returns:
    current state
  See Also:
    `EntityStates`

### setRecursionMode

    void setRecursionMode(int recursionMode)

  Sets the current recursion mode. The recursion mode specifies the approach taken to parsing parts. `RecursionMode.M_RAW` mode does not parse the part at all. `RecursionMode.M_RECURSE` mode recursively parses each mail when an `message/rfc822` part is encounted; `RecursionMode.M_NO_RECURSE` does not.

  Parameters:
    `recursionMode` -
  See Also:
    `RecursionMode`

### advance

    EntityStateMachine advance()
                               throws java.io.IOException,
                                      MimeException

  Advances the state machine to the next state in the process of the MIME stream parsing. This method may return an new state machine that represents an embedded entity, which must be parsed before the parsing process of the current entity can proceed.

  Returns:
    a state machine of an embedded entity, if encountered, `null` otherwise.
  Throws:
    `java.io.IOException` - if an I/O error occurs.
    `MimeException` - if the message can not be processed due to the MIME specification violation.

### getBodyDescriptor

    BodyDescriptor getBodyDescriptor()
                                     throws java.lang.IllegalStateException

  Returns description of the entity body.

  Returns:
    body description
  Throws:
    `java.lang.IllegalStateException` - if the body description cannot be obtained at the current stage of the parsing process.

### getContentStream

    java.io.InputStream getContentStream()
                                         throws java.lang.IllegalStateException

  Returns content stream of the entity body.

  Returns:
    input stream
  Throws:
    `java.lang.IllegalStateException` - if the content stream cannot be obtained at the current stage of the parsing process.

### getField

    java.lang.String getField()
                              throws java.lang.IllegalStateException

  Returns current header field.

  Returns:
    header field
  Throws:
    `java.lang.IllegalStateException` - if a header field cannot be obtained at the current stage of the parsing process.

### getFieldName

    java.lang.String getFieldName()
                                  throws java.lang.IllegalStateException

  Returns name of the current header field.

  Returns:
    field name
  Throws:
    `java.lang.IllegalStateException` - if a header field cannot be obtained at the current stage of the parsing process.

### getFieldValue

    java.lang.String getFieldValue()
                                   throws java.lang.IllegalStateException

  Returns value of the current header field.

  Returns:
    field value
  Throws:
    `java.lang.IllegalStateException` - if a header field cannot be obtained at the current stage of the parsing process.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.