Home | History | Annotate | Download | only in domts
      1 /*
      2  * Copyright (c) 2004 World Wide Web Consortium,
      3  * (Massachusetts Institute of Technology, Institut National de
      4  * Recherche en Informatique et en Automatique, Keio University). All
      5  * Rights Reserved. This program is distributed under the W3C's Software
      6  * Intellectual Property License. This program is distributed in the
      7  * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
      8  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
      9  * PURPOSE.
     10  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
     11  */
     12 
     13 package org.w3c.domts;
     14 
     15 import org.w3c.dom.DOMError;
     16 import org.w3c.dom.DOMLocator;
     17 
     18 /**
     19  *   This is a utility implementation of EventListener
     20  *      that captures all events and provides access
     21  *      to lists of all events by mode
     22  */
     23 public class DOMErrorImpl
     24     implements DOMError {
     25   private final short severity;
     26   private final String message;
     27   private final String type;
     28   private final Object relatedException;
     29   private final Object relatedData;
     30   private final DOMLocator location;
     31 
     32   /**
     33    * Public constructor
     34    *
     35    */
     36   public DOMErrorImpl(DOMError src) {
     37     this.severity = src.getSeverity();
     38     this.message = src.getMessage();
     39     this.type = src.getType();
     40     this.relatedException = src.getRelatedException();
     41     this.relatedData = src.getRelatedData();
     42     this.location = new DOMLocatorImpl(src.getLocation());
     43   }
     44 
     45   public final short getSeverity() {
     46     return severity;
     47   }
     48 
     49   public final String getMessage() {
     50     return message;
     51   }
     52 
     53   public final String getType() {
     54     return type;
     55   }
     56 
     57   public final Object getRelatedException() {
     58     return relatedException;
     59   }
     60 
     61   public final Object getRelatedData() {
     62     return relatedData;
     63   }
     64 
     65   public final DOMLocator getLocation() {
     66     return location;
     67   }
     68 }
     69