Package org.beryx.textio
Class TextIoFactory
- java.lang.Object
-
- org.beryx.textio.TextIoFactory
-
public class TextIoFactory extends java.lang.ObjectProvidesTextTerminalandTextIOimplementations.
The concreteTextTerminalimplementation is obtained as follows:- If the system property "org.beryx.textio.TextTerminal" is defined, then it is
taken to be the fully-qualified name of a concrete
TextTerminalclass. The class is loaded and instantiated. If this process fails, then the next step is executed. - a
ServiceLoaderloads the configuredTextTerminalProviders and searches for the first one capable to provide aTextTerminalinstance. If none is found, then the next step is executed. - A default implementation is provided as follows:
- if
System.console()is not null, and a JLine ConsoleReader can be created, then aJLineTextTerminalis provided. - else, if
System.console()is not null, then aConsoleTextTerminalis provided. - else, if the system is not headless, then a
SwingTextTerminalis provided. - else, a
SystemTextTerminalis provided
- if
- If the system property "org.beryx.textio.TextTerminal" is defined, then it is
taken to be the fully-qualified name of a concrete
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTEXT_TERMINAL_CLASS_PROPERTY
-
Constructor Summary
Constructors Constructor Description TextIoFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TextIOgetTextIO()static TextTerminal<?>getTextTerminal()
-
-
-
Field Detail
-
TEXT_TERMINAL_CLASS_PROPERTY
public static final java.lang.String TEXT_TERMINAL_CLASS_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTextTerminal
public static TextTerminal<?> getTextTerminal()
-
getTextIO
public static TextIO getTextIO()
-
-