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