KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jicengine > element > ElementException


1 package org.jicengine.element;
2
3 import org.jicengine.JICException;
4
5 /**
6  * <p>
7  * Copyright (C) 2004 Timo Laitinen
8  * </p>
9  * @author Timo Laitinen
10  * @created 2004-09-20
11  * @since JICE-0.10
12  *
13  */

14
15 public class ElementException extends JICException {
16
17     public ElementException(String JavaDoc message, String JavaDoc elementName, Location location)
18     {
19         super(decorateMessage(message, elementName, location));
20     }
21
22     public ElementException(String JavaDoc message, String JavaDoc elementName, String JavaDoc attributeName, Location location)
23     {
24         super(message + " (<" + elementName + ">//" + attributeName + " at " + location + ")");
25     }
26
27     public ElementException(String JavaDoc message, Throwable JavaDoc cause, String JavaDoc elementName, Location location)
28     {
29         super(decorateMessage(message, elementName, location), cause);
30     }
31
32     public ElementException(Throwable JavaDoc cause, String JavaDoc elementName, Location location)
33     {
34         super(decorateMessage(cause.getMessage(), elementName, location), cause);
35     }
36
37     public ElementException(Throwable JavaDoc cause, String JavaDoc elementName, String JavaDoc attributeName, Location location)
38     {
39         super(cause.getMessage() + " (<" + elementName + ">//" + attributeName + " at " + location + ")", cause);
40     }
41
42     private static String JavaDoc decorateMessage(String JavaDoc message, String JavaDoc elementName, Location location)
43     {
44         return message + " (<" + elementName + "> at " + location + ")";
45     }
46 }
47
Popular Tags