1 23 package com.sun.enterprise.deployment; 24 25 import com.sun.enterprise.deployment.web.ErrorPageDescriptor; 26 27 31 32 public class ErrorPageDescriptorImpl implements ErrorPageDescriptor, java.io.Serializable { 33 private int errorCode; 34 private String exceptionType; 35 private String location; 36 37 39 public ErrorPageDescriptorImpl() { 40 41 } 42 43 44 public ErrorPageDescriptorImpl(int errorCode, String location) { 45 this.errorCode = errorCode; 46 this.location = location; 47 } 48 49 50 public ErrorPageDescriptorImpl(String exceptionType, String location) { 51 this.exceptionType = exceptionType; 52 this.location = location; 53 } 54 55 public int getErrorCode() { 56 return this.errorCode; 57 } 58 59 public void setErrorCode(int errorCode) { 60 this.errorCode = errorCode; 61 } 62 63 public String getErrorSignifierAsString() { 64 if ("".equals(this.getExceptionType())) { 65 return (new Integer (this.getErrorCode())).toString(); 66 } 67 return this.getExceptionType(); 68 } 69 70 public void setErrorSignifierAsString(String errorSignifier) { 71 try { 72 int errorCode = Integer.parseInt(errorSignifier); 73 this.setErrorCode(errorCode); 74 this.setExceptionType(null); 75 return; 76 } catch (NumberFormatException nfe) { 77 78 } 79 this.setExceptionType(errorSignifier); 80 } 81 82 83 public String getExceptionType() { 84 if (this.exceptionType == null) { 85 this.exceptionType = ""; 86 } 87 return this.exceptionType; 88 } 89 90 91 public void setExceptionType(String exceptionType) { 92 this.exceptionType = exceptionType; 93 } 94 95 public String getLocation() { 96 if (this.location == null) { 97 this.location = ""; 98 } 99 return this.location; 100 } 101 102 public void setLocation(String location) { 103 this.location = location; 104 } 105 106 public void print(StringBuffer toStringBuffer) { 107 toStringBuffer.append("ErrorPage ").append(this.getErrorCode()).append(" ").append( 108 this.getExceptionType()).append(" ").append(this.getLocation()); 109 } 110 111 } 112 113 | Popular Tags |