1package eu.siacs.conversations.xmpp.jid;
2
3public class InvalidJidException extends Exception {
4
5 // This is probably not the "Java way", but the "Java way" means we'd have a ton of extra tiny,
6 // annoying classes floating around. I like this.
7 public final static String INVALID_LENGTH = "JID must be between 0 and 3071 characters";
8 public final static String INVALID_PART_LENGTH = "JID part must be between 0 and 1023 characters";
9 public final static String INVALID_CHARACTER = "JID contains an invalid character";
10 public final static String STRINGPREP_FAIL = "The STRINGPREP operation has failed for the given JID";
11 public final static String IS_NULL = "JID can not be NULL";
12
13 /**
14 * Constructs a new {@code Exception} that includes the current stack trace.
15 */
16 public InvalidJidException() {
17 }
18
19 /**
20 * Constructs a new {@code Exception} with the current stack trace and the
21 * specified detail message.
22 *
23 * @param detailMessage the detail message for this exception.
24 */
25 public InvalidJidException(final String detailMessage) {
26 super(detailMessage);
27 }
28
29 /**
30 * Constructs a new {@code Exception} with the current stack trace, the
31 * specified detail message and the specified cause.
32 *
33 * @param detailMessage the detail message for this exception.
34 * @param throwable the cause of this exception.
35 */
36 public InvalidJidException(final String detailMessage, final Throwable throwable) {
37 super(detailMessage, throwable);
38 }
39
40 /**
41 * Constructs a new {@code Exception} with the current stack trace and the
42 * specified cause.
43 *
44 * @param throwable the cause of this exception.
45 */
46 public InvalidJidException(final Throwable throwable) {
47 super(throwable);
48 }
49}