001 /** 002 * 003 * Copyright 2003-2004 The Apache Software Foundation 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); 006 * you may not use this file except in compliance with the License. 007 * You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 018 package javax.mail.internet; 019 020 /** 021 * @version $Rev: 54266 $ $Date: 2004-10-10 14:02:50 -0700 (Sun, 10 Oct 2004) $ 022 */ 023 public class AddressException extends ParseException { 024 protected int pos; 025 protected String ref; 026 027 public AddressException() { 028 this(null); 029 } 030 031 public AddressException(String message) { 032 this(message, null); 033 } 034 035 public AddressException(String message, String ref) { 036 this(message, null, -1); 037 } 038 039 public AddressException(String message, String ref, int pos) { 040 super(message); 041 this.ref = ref; 042 this.pos = pos; 043 } 044 045 public String getRef() { 046 return ref; 047 } 048 049 public int getPos() { 050 return pos; 051 } 052 053 public String toString() { 054 return super.toString() + " (" + ref + "," + pos + ")"; 055 } 056 }