1 package cz.cuni.amis.pogamut.sposh.exceptions;
2
3 import cz.cuni.amis.pogamut.sposh.elements.PoshElement;
4 import java.text.MessageFormat;
5
6
7
8
9
10 public class UnexpectedElementException extends RuntimeException {
11
12
13
14
15
16
17 public static UnexpectedElementException create(PoshElement element) {
18 String elementName = element != null ? element.getClass().getCanonicalName() : "'null'";
19 String msg = MessageFormat.format("Unexpected lap element ({0}).", elementName);
20 return new UnexpectedElementException(msg);
21 }
22
23 public UnexpectedElementException(String message) {
24 super(message);
25 }
26
27 }