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
12 /**
13 * Constructs a new {@code Exception} that includes the current stack trace.
14 */
15 public InvalidJidException() {
16 }
17
18 /**
19 * Constructs a new {@code Exception} with the current stack trace and the
20 * specified detail message.
21 *
22 * @param detailMessage the detail message for this exception.
23 */
24 public InvalidJidException(final String detailMessage) {
25 super(detailMessage);
26 }
27
28 /**
29 * Constructs a new {@code Exception} with the current stack trace, the
30 * specified detail message and the specified cause.
31 *
32 * @param detailMessage the detail message for this exception.
33 * @param throwable the cause of this exception.
34 */
35 public InvalidJidException(final String detailMessage, final Throwable throwable) {
36 super(detailMessage, throwable);
37 }
38
39 /**
40 * Constructs a new {@code Exception} with the current stack trace and the
41 * specified cause.
42 *
43 * @param throwable the cause of this exception.
44 */
45 public InvalidJidException(final Throwable throwable) {
46 super(throwable);
47 }
48}