home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Java / JDesignerPro / Jdp3_0.exe / data1.cab / Program_Files / javax / naming / NamingException.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-04-09  |  2.6 KB  |  117 lines

  1. package javax.naming;
  2.  
  3. public class NamingException extends Exception {
  4.    protected Name resolvedName;
  5.    protected Object resolvedObj;
  6.    protected Name remainingName;
  7.    protected Throwable rootException;
  8.  
  9.    public NamingException(String var1) {
  10.       super(var1);
  11.       this.resolvedName = this.remainingName = null;
  12.       this.resolvedObj = null;
  13.    }
  14.  
  15.    public NamingException() {
  16.       this.resolvedName = this.remainingName = null;
  17.       this.resolvedObj = null;
  18.    }
  19.  
  20.    public Name getResolvedName() {
  21.       return this.resolvedName;
  22.    }
  23.  
  24.    public Name getRemainingName() {
  25.       return this.remainingName;
  26.    }
  27.  
  28.    public Object getResolvedObj() {
  29.       return this.resolvedObj;
  30.    }
  31.  
  32.    public String getExplanation() {
  33.       return ((Throwable)this).getMessage();
  34.    }
  35.  
  36.    public void setResolvedName(Name var1) {
  37.       if (var1 != null) {
  38.          this.resolvedName = (Name)var1.clone();
  39.       } else {
  40.          this.resolvedName = null;
  41.       }
  42.    }
  43.  
  44.    public void setRemainingName(Name var1) {
  45.       if (var1 != null) {
  46.          this.remainingName = (Name)var1.clone();
  47.       } else {
  48.          this.remainingName = null;
  49.       }
  50.    }
  51.  
  52.    public void setResolvedObj(Object var1) {
  53.       this.resolvedObj = var1;
  54.    }
  55.  
  56.    public void appendRemainingComponent(String var1) {
  57.       if (var1 != null) {
  58.          try {
  59.             if (this.remainingName == null) {
  60.                this.remainingName = new CompositeName();
  61.                this.remainingName.add(var1);
  62.             } else {
  63.                this.remainingName.add(var1);
  64.             }
  65.          } catch (NamingException var3) {
  66.             throw new IllegalArgumentException(var3.toString());
  67.          }
  68.       }
  69.    }
  70.  
  71.    public void appendRemainingName(Name var1) {
  72.       if (var1 != null) {
  73.          if (this.remainingName != null) {
  74.             try {
  75.                this.remainingName.addAll(var1);
  76.             } catch (NamingException var3) {
  77.                throw new IllegalArgumentException(var3.toString());
  78.             }
  79.          } else {
  80.             this.remainingName = (Name)var1.clone();
  81.          }
  82.       }
  83.    }
  84.  
  85.    public Throwable getRootCause() {
  86.       return this.rootException;
  87.    }
  88.  
  89.    public void setRootCause(Throwable var1) {
  90.       if (var1 != this) {
  91.          this.rootException = var1;
  92.       }
  93.  
  94.    }
  95.  
  96.    public String toString() {
  97.       String var1;
  98.       if (this.rootException != null && this.rootException != this) {
  99.          var1 = "[Root exception is " + this.rootException.toString() + "]";
  100.       } else {
  101.          var1 = "";
  102.       }
  103.  
  104.       if (this.remainingName != null) {
  105.          var1 = var1 + super.toString() + "; Remaining Name: '" + this.remainingName + "'";
  106.       } else {
  107.          var1 = var1 + super.toString();
  108.       }
  109.  
  110.       return var1;
  111.    }
  112.  
  113.    public String toString(boolean var1) {
  114.       return var1 && this.resolvedObj != null ? this.toString() + "; Resolved Object: " + this.resolvedObj : this.toString();
  115.    }
  116. }
  117.