src/jdk.internal.le/share/classes/jdk/internal/jline/console/UserInterruptException.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 31530 jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/console/UserInterruptException.java@aa87d96a02b1
child 50338 1d5694c1aa03
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31530
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
     1
/*
aa87d96a02b1 8080679: Include jline in JDK for Java and JavaScript REPLs
jlahoda
parents:
diff changeset
     2
 * Copyright (c) 2002-2012, the original author or authors.
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
}