Since the project targets the J2ME environment, the implementation has to respect the limited resources available there. In particular this implies that it's not possible to represent every tiny piece of information an e-mail contains or may contain by a specilized Java class, so the level of abstraction is somewhat lower than the one used by JavaMail.
The basic concepts of the implementation look like this:
Pop3Client class, an ImapClient
class and an SmtpClient class for
the various protocols as well as a MailException class
to report errors during sessions. To make run-time selection of
protocols easy for application programmers, both Pop3Client
and ImapClient implement the interface .
Message is represented by a line-oriented data structure
encapsulated in a class with exactly that name, basically
separating the header and body parts. This representation is
easy to implement as well as easy to use, and it requires
little memory. It's also very close to the data format that
is used during actual transmission, so there's not much
transformation needed, which makes it reasonably fast even
on the typically not-so-fast J2ME devices.
MimeDecoder class allows to access to the
tree-like hierarchy of body parts in a MIME-encoded
message.