author | jlahoda |
Fri, 01 Jun 2018 13:04:30 +0200 | |
changeset 50338 | 1d5694c1aa03 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
31530
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
1 |
/* |
50338 | 2 |
* Copyright (c) 2002-2016, the original author or authors. |
31530
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
3 |
* |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
4 |
* This software is distributable under the BSD license. See the terms of the |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
5 |
* BSD license in the documentation provided with this software. |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
6 |
* |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
7 |
* http://www.opensource.org/licenses/bsd-license.php |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
8 |
*/ |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
9 |
package jdk.internal.jline.console; |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
10 |
|
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
11 |
/** |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
12 |
* This exception is thrown by {@link ConsoleReader#readLine} when |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
13 |
* user interrupt handling is enabled and the user types the |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
14 |
* interrupt character (ctrl-C). The partially entered line is |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
15 |
* available via the {@link #getPartialLine()} method. |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
16 |
*/ |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
17 |
public class UserInterruptException |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
18 |
extends RuntimeException |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
19 |
{ |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
20 |
private static final long serialVersionUID = 6172232572140736750L; |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
21 |
|
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
22 |
private final String partialLine; |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
23 |
|
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
24 |
public UserInterruptException(String partialLine) |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
25 |
{ |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
26 |
this.partialLine = partialLine; |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
27 |
} |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
28 |
|
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
29 |
/** |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
30 |
* @return the partially entered line when ctrl-C was pressed |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
31 |
*/ |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
32 |
public String getPartialLine() |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
33 |
{ |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
34 |
return partialLine; |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
35 |
} |
aa87d96a02b1
8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff
changeset
|
36 |
} |