Package org.python.core

# Interface Console

All Known Implementing Classes:
  `JLineConsole`, `PlainConsole`

public interface Console
A class named in configuration as the value of `python.console` must implement this interface, and provide a constructor with a single `String` argument, to be acceptable during initialization of the interpreter. The argument to the constructor names the encoding in use on the console. Such a class may provide line editing and history recall to an interactive console. A default implementation (that does not provide any such facilities) is available as `PlainConsole`.

See Also:
  - `RegistryKey.PYTHON_CONSOLE`

## Method Summary

Modifier and Type
Method
Description
`String`
`getEncoding()`
Name of the encoding, normally supplied during initialisation, and used for line input.
`Charset`
`getEncodingCharset()`
Accessor for encoding to use for line input as a `Charset`.
`void`
`install()`
Complete initialization and (optionally) install a stream object with line-editing as the replacement for `System.in`.
`void`
`uninstall()`
Uninstall the Console (if possible).

## Method Details

### install

void install() throws IOException
Complete initialization and (optionally) install a stream object with line-editing as the replacement for `System.in`.

Throws:
  `IOException` - in case of failure related to i/o

### uninstall

void uninstall() throws UnsupportedOperationException
Uninstall the Console (if possible). A Console that installs a replacement for `System.in` should put back the original value.

Throws:
  `UnsupportedOperationException` - if the Console cannot be uninstalled

### getEncoding

String getEncoding()
Name of the encoding, normally supplied during initialisation, and used for line input. This may not be the cononoical name of the codec returned by `getEncodingCharset()`.

Returns:
  name of the encoding in use.

### getEncodingCharset

Charset getEncodingCharset()
Accessor for encoding to use for line input as a `Charset`.

Returns:
  Charset of the encoding in use.