View Javadoc

1   /***
2    * 
3    */
4   package net.trajano.twiff.renderer;
5   
6   import org.xml.sax.Attributes;
7   import org.xml.sax.Locator;
8   import org.xml.sax.SAXException;
9   
10  /***
11   * This exception is thrown when there is a problem building an element. It is
12   * made as a SAXException since this only occurs during SAX parsing events.
13   * 
14   * @author Archimedes Trajano
15   */
16  public class ElementBuilderException extends SAXException {
17      /***
18       * @param locator
19       * @param uri
20       * @param localName
21       * @param qName
22       * @param attributes
23       */
24      public ElementBuilderException(final Locator locator, final String uri, String localName, String qName, Attributes attributes) {
25          super();
26          this.locator = locator;
27          this.uri = uri;
28          this.localName = localName;
29          this.qName = qName;
30          this.attributes = attributes;
31      }
32  
33      /***
34       * @param locator
35       * @param uri
36       * @param localName
37       * @param qName
38       * @param attributes
39       * @param exception
40       *                   the root cause exception
41       */
42      public ElementBuilderException(final Locator locator, final String uri, String localName, String qName, Attributes attributes, final Exception exception) {
43          super(exception);
44          this.locator = locator;
45          this.uri = uri;
46          this.localName = localName;
47          this.qName = qName;
48          this.attributes = attributes;
49      }
50  
51      /***
52       * This returns the locator associated with the exception.
53       * 
54       * @return the locator
55       */
56      public final Locator getLocator() {
57          return locator;
58      }
59  
60      /***
61       * The locator.
62       */
63      private final Locator locator;
64  
65      /***
66       * 
67       */
68      private final String uri;
69  
70      /***
71       * 
72       */
73      private final String localName;
74  
75      /***
76       * 
77       */
78      private final String qName;
79  
80      /***
81       * 
82       */
83      private final Attributes attributes;
84  }