Package org.python.core
Interface Console
-
- All Known Implementing Classes:
JLineConsole,PlainConsole
public interface ConsoleA class named in configuration as the value ofpython.consolemust implement this interface, and provide a constructor with a singleStringargument, 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 asPlainConsole.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetEncoding()Name of the encoding, normally supplied during initialisation, and used for line input.java.nio.charset.CharsetgetEncodingCharset()Accessor for encoding to use for line input as aCharset.voidinstall()Complete initialization and (optionally) install a stream object with line-editing as the replacement forSystem.in.voiduninstall()Uninstall the Console (if possible).
-
-
-
Method Detail
-
install
void install() throws java.io.IOExceptionComplete initialization and (optionally) install a stream object with line-editing as the replacement forSystem.in.- Throws:
java.io.IOException- in case of failure related to i/o
-
uninstall
void uninstall() throws java.lang.UnsupportedOperationExceptionUninstall the Console (if possible). A Console that installs a replacement forSystem.inshould put back the original value.- Throws:
java.lang.UnsupportedOperationException- if the Console cannot be uninstalled
-
getEncoding
java.lang.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 bygetEncodingCharset().- Returns:
- name of the encoding in use.
-
getEncodingCharset
java.nio.charset.Charset getEncodingCharset()
Accessor for encoding to use for line input as aCharset.- Returns:
- Charset of the encoding in use.
-
-