View Javadoc
1 /************************************************************ 2 * Copyright * 3 * Portions of this software are Copyright (c) 1993 - 2002, * 4 * Chad Z. Hower (Kudzu) and the Indy Pit Crew * 5 * - http://www.nevrona.com/Indy/ * 6 ************************************************************/ 7 package org.indy.messages; 8 9 import java.util.StringTokenizer; 10 11 12 /*** 13 * DOCUMENT ME! 14 * 15 * @version $Revision$ 16 * @author $author$ 17 */ 18 public class RFC822MessageParser { 19 private String openingPhrase; 20 21 /*** 22 * DOCUMENT ME! 23 * 24 * @param address DOCUMENT ME! 25 * 26 * @throws AddressParseException DOCUMENT ME! 27 */ 28 public void parse(String address) throws AddressParseException { 29 int groupDelimEnd = address.indexOf(';'); 30 int groupDelimBegin = address.indexOf(':'); 31 32 if ((groupDelimBegin > -1) && (groupDelimEnd > -1) && 33 (groupDelimEnd > groupDelimBegin)) { 34 group(address.substring(groupDelimBegin + 1, groupDelimEnd - 1)); 35 36 if ((groupDelimBegin != 0) && (groupDelimEnd - groupDelimBegin > 1)) { 37 openingPhrase = address.substring(0, groupDelimBegin - 1); 38 } 39 } 40 } 41 42 private void mailbox(String mailBox) { 43 } 44 45 private void group(String mailBoxList) throws AddressParseException { 46 StringTokenizer tok = new StringTokenizer(mailBoxList, ","); 47 48 while (tok.hasMoreTokens()) { 49 } 50 } 51 52 private void phrase(String phrase) throws AddressParseException { 53 if (phrase.startsWith("\"")) { 54 quotedString(phrase); 55 } 56 else { 57 atom(phrase); 58 } 59 } 60 61 private void quotedString(String str) throws AddressParseException { 62 if (!str.endsWith("\"")) { 63 throw new AddressParseException("Non terminated quoted string"); 64 } 65 66 // String sans_quotes = 67 } 68 69 private void atom(String atom) { 70 } 71 }

This page was automatically generated by Maven