FileDocCategorySizeDatePackage
AddressException.javaAPI DocJavaMail 1.4.33839Tue Nov 17 10:38:12 GMT 2009javax.mail.internet

AddressException

public class AddressException extends ParseException
The exception thrown when a wrongly formatted address is encountered.
author
Bill Shannon
author
Max Spivak

Fields Summary
protected String
ref
The string being parsed.
protected int
pos
The index in the string where the error occurred, or -1 if not known.
private static final long
serialVersionUID
Constructors Summary
public AddressException()
Constructs an AddressException with no detail message.


                
      
	super();
    
public AddressException(String s)
Constructs an AddressException with the specified detail message.

param
s the detail message

	super(s);
    
public AddressException(String s, String ref)
Constructs an AddressException with the specified detail message and reference info.

param
s the detail message

	super(s);
	this.ref = ref;
    
public AddressException(String s, String ref, int pos)
Constructs an AddressException with the specified detail message and reference info.

param
s the detail message

	super(s);
	this.ref = ref;
	this.pos = pos;
    
Methods Summary
public intgetPos()
Get the position with the reference string where the error was detected (-1 if not relevant).

	return pos;
    
public java.lang.StringgetRef()
Get the string that was being parsed when the error was detected (null if not relevant).

	return ref;
    
public java.lang.StringtoString()

	String s = super.toString();
	if (ref == null)
	    return s;
	s += " in string ``" + ref + "''";
	if (pos < 0)
	    return s;
	return s + " at position " + pos;