FileDocCategorySizeDatePackage
ContentHandlerException.javaAPI DocphoneME MR2 API (J2ME)3236Wed May 02 18:00:44 BST 2007javax.microedition.content

ContentHandlerException

public class ContentHandlerException extends IOException
A ContentHandlerException is thrown to report errors specific to registration and invocation of content handlers. Instances are immutable and thread safe.

Fields Summary
private int
errcode
The error code.
public static final int
NO_REGISTERED_HANDLER
The reason is NO_REGISTERED_HANDLER in a ContentHandlerException when there is no content handler registered of the requested combination of ID, type, suffix, and action.
public static final int
TYPE_UNKNOWN
The reason is TYPE_UNKNOWN in a ContentHandlerException when the type is not available.
public static final int
AMBIGUOUS
The reason is AMBIGUOUS in a ContentHandlerException when an ID does not uniquely identify a single content handler application.
Constructors Summary
public ContentHandlerException(String reason, int errcode)
Constructs a ContentHandlerException with a reason and error code. The error message string reason can later be retrieved by the {@link java.lang.Throwable#getMessage java.lang.Throwable.getMessage} method.

param
reason the reason for the exception
param
errcode the error code; one of {@link #NO_REGISTERED_HANDLER}, {@link #AMBIGUOUS}, or {@link #TYPE_UNKNOWN}
exception
IllegalArgumentException if errcode is not one of {@link #NO_REGISTERED_HANDLER}, {@link #AMBIGUOUS}, or {@link #TYPE_UNKNOWN}


                                                                            
         
	super(reason);
	if (errcode < NO_REGISTERED_HANDLER ||
	    errcode > AMBIGUOUS) {
	    throw new IllegalArgumentException();
	}
	this.errcode = errcode;
    
Methods Summary
public intgetErrorCode()
Returns the error code for the exception.

return
the error code; one of {@link #NO_REGISTERED_HANDLER}, {@link #AMBIGUOUS}, or {@link #TYPE_UNKNOWN}

	return errcode;