Exemple #1
0
  private void parse() {
    String body = getBody();

    try {
      addressList = AddressList.parse(body);
    } catch (ParseException e) {
      if (log.isDebugEnabled()) {
        log.debug("Parsing value '" + body + "': " + e.getMessage());
      }
      parseException = e;
    }

    parsed = true;
  }
 public Field parse(final String name, final String body, final String raw) {
   Mailbox mailbox = null;
   ParseException parseException = null;
   try {
     MailboxList mailboxList = AddressList.parse(body).flatten();
     if (mailboxList.size() > 0) {
       mailbox = mailboxList.get(0);
     }
   } catch (ParseException e) {
     if (log.isDebugEnabled()) {
       log.debug("Parsing value '" + body + "': " + e.getMessage());
     }
     parseException = e;
   }
   return new MailboxField(name, body, raw, mailbox, parseException);
 }