01: package org.jicengine.element;
02:
03: import org.jicengine.JICException;
04:
05: /**
06: * <p>
07: * Copyright (C) 2004 Timo Laitinen
08: * </p>
09: * @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 message, String elementName,
18: Location location) {
19: super (decorateMessage(message, elementName, location));
20: }
21:
22: public ElementException(String message, String elementName,
23: String attributeName, Location location) {
24: super (message + " (<" + elementName + ">//" + attributeName
25: + " at " + location + ")");
26: }
27:
28: public ElementException(String message, Throwable cause,
29: String elementName, Location location) {
30: super (decorateMessage(message, elementName, location), cause);
31: }
32:
33: public ElementException(Throwable cause, String elementName,
34: Location location) {
35: super (
36: decorateMessage(cause.getMessage(), elementName,
37: location), cause);
38: }
39:
40: public ElementException(Throwable cause, String elementName,
41: String attributeName, Location location) {
42: super (cause.getMessage() + " (<" + elementName + ">//"
43: + attributeName + " at " + location + ")", cause);
44: }
45:
46: private static String decorateMessage(String message,
47: String elementName, Location location) {
48: return message + " (<" + elementName + "> at " + location + ")";
49: }
50: }
|