FileDocCategorySizeDatePackage
ErrorPageDescriptorImpl.javaAPI DocGlassfish v2 API4765Fri May 04 22:31:22 BST 2007None

ErrorPageDescriptorImpl

public class ErrorPageDescriptorImpl extends Object implements com.sun.enterprise.deployment.web.ErrorPageDescriptor, Serializable
Objects exhiniting this interface represent an error page and the exception type or error code that will cause the redirect from the web container.
author
Danny Coward

Fields Summary
private int
errorCode
private String
exceptionType
private String
location
Constructors Summary
public ErrorPageDescriptorImpl()
The default constructor.

    
    
public ErrorPageDescriptorImpl(int errorCode, String location)
Constructor for error code to error page mapping.

	this.errorCode = errorCode;
	this.location = location;
    
public ErrorPageDescriptorImpl(String exceptionType, String location)
Constructor for Java exception type to error page mapping.

	this.exceptionType = exceptionType;
	this.location = location;
    
Methods Summary
public intgetErrorCode()
Return the error code. -1 if none.

	return this.errorCode;
    
public java.lang.StringgetErrorSignifierAsString()
Return the error code as a string if there is no exception type, or the exception type if the error code is -1.

	if ("".equals(this.getExceptionType())) {
	    return (Integer.valueOf(this.getErrorCode())).toString();
	}
	return this.getExceptionType();
    
public java.lang.StringgetExceptionType()
Return the exception type or the empty string if none.

	if (this.exceptionType == null) {
	    this.exceptionType = "";
	}
	return this.exceptionType;
    
public java.lang.StringgetLocation()
Return the page to map to

	if (this.location == null) {
	    this.location = "";
	}
	return this.location;
    
public voidprint(java.lang.StringBuffer toStringBuffer)

	toStringBuffer.append("ErrorPage ").append(this.getErrorCode()).append(" ").append(
            this.getExceptionType()).append(" ").append(this.getLocation());
    
public voidsetErrorCode(int errorCode)
Sets the error code.

	this.errorCode = errorCode;
    
public voidsetErrorSignifierAsString(java.lang.String errorSignifier)
Sets the error code if the argument is parsable as an int, or the exception type else.

	try {
	    int errorCode = Integer.parseInt(errorSignifier);
	    this.setErrorCode(errorCode);
	    this.setExceptionType(null);
	    return;
	} catch (NumberFormatException nfe) {
	
	}
	this.setExceptionType(errorSignifier);
    
public voidsetExceptionType(java.lang.String exceptionType)
Sets the exception type.

	this.exceptionType = exceptionType;
    
public voidsetLocation(java.lang.String location)

	this.location = location;