Class ISO6429IO
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.terminal.ISO6429IO
-
- All Implemented Interfaces:
IOInterface
public class ISO6429IO extends Object implements IOInterface
ISO 6429 (cursor addressing spec) compliant implementation of theIOInterface
. This has a basic command line history accessible with up and down arrows.Created by Jeff Gaynor
on 6/9/20 at 7:52 AM
-
-
Constructor Summary
Constructors Constructor Description ISO6429IO(boolean noBanner)
ISO6429IO(MyLoggingFacade loggingFacade, boolean noBanner)
ISO6429IO(ISO6429Terminal terminal, boolean noBanner)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCommandHistory(List<String> commands)
void
clearCommandBuffer()
void
clearQueue()
Some implementations will have a queue e.g.protected void
debug(String x)
void
flush()
Flush anything waiting to be printed.ArrayList<String>
getCommandCompletion()
MyLoggingFacade
getLoggingFacade()
int[]
getScreenSize()
ISO6429Terminal
getTerminal()
protected void
info(String x)
protected void
init(boolean noBanner)
boolean
isBufferingOn()
return current state of buffering.boolean
isQueueEmpty()
Check if the queue is empty.static void
main(String[] args)
void
print(Object x)
Print the string representation of an object, without a carriage return.void
println(Object x)
Print the string representation of an object with a carriage return.String
readline()
Read a line of input with no prompt.String
readline(String prompt)
read a line of input, printing the prompt (on the left) first.void
setBufferingOn(boolean bufferingOn)
If this object supports buffering of commands, this will toggle it.void
setCommandCompletion(ArrayList<String> commandCompletion)
void
setLoggingFacade(MyLoggingFacade loggingFacade)
protected void
warn(String x, Throwable t)
-
-
-
Constructor Detail
-
ISO6429IO
public ISO6429IO(MyLoggingFacade loggingFacade, boolean noBanner) throws IOException
- Throws:
IOException
-
ISO6429IO
public ISO6429IO(ISO6429Terminal terminal, boolean noBanner) throws IOException
- Throws:
IOException
-
ISO6429IO
public ISO6429IO(boolean noBanner) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getLoggingFacade
public MyLoggingFacade getLoggingFacade()
-
setLoggingFacade
public void setLoggingFacade(MyLoggingFacade loggingFacade)
-
clearCommandBuffer
public void clearCommandBuffer()
-
readline
public String readline() throws IOException
Description copied from interface:IOInterface
Read a line of input with no prompt.- Specified by:
readline
in interfaceIOInterface
- Returns:
- Throws:
IOException
-
readline
public String readline(String prompt) throws IOException
Description copied from interface:IOInterface
read a line of input, printing the prompt (on the left) first. The prompt is not returned.- Specified by:
readline
in interfaceIOInterface
- Returns:
- Throws:
IOException
-
getTerminal
public ISO6429Terminal getTerminal() throws IOException
- Throws:
IOException
-
print
public void print(Object x)
Description copied from interface:IOInterface
Print the string representation of an object, without a carriage return.- Specified by:
print
in interfaceIOInterface
-
println
public void println(Object x)
Description copied from interface:IOInterface
Print the string representation of an object with a carriage return.- Specified by:
println
in interfaceIOInterface
-
flush
public void flush()
Description copied from interface:IOInterface
Flush anything waiting to be printed. Normally this is done with the print methods.- Specified by:
flush
in interfaceIOInterface
-
init
protected void init(boolean noBanner) throws IOException
- Throws:
IOException
-
getScreenSize
public int[] getScreenSize() throws IOException
- Throws:
IOException
-
main
public static void main(String[] args)
-
info
protected void info(String x)
-
debug
protected void debug(String x)
-
clearQueue
public void clearQueue()
Description copied from interface:IOInterface
Some implementations will have a queue e.g. if the user paste text from the clipboard). TheIOInterface.readline(String)
methods will queue these up and return them in sequence -- this is done silently. If for some reason you need only a single line and want to discard anything else, invoke this.- Specified by:
clearQueue
in interfaceIOInterface
-
isQueueEmpty
public boolean isQueueEmpty()
Description copied from interface:IOInterface
Check if the queue is empty.- Specified by:
isQueueEmpty
in interfaceIOInterface
- Returns:
-
setBufferingOn
public void setBufferingOn(boolean bufferingOn)
Description copied from interface:IOInterface
If this object supports buffering of commands, this will toggle it. Buffering means that every result ofIOInterface.readline(String)
will be stored and up down arrows will cycle through them.- Specified by:
setBufferingOn
in interfaceIOInterface
-
isBufferingOn
public boolean isBufferingOn()
Description copied from interface:IOInterface
return current state of buffering.- Specified by:
isBufferingOn
in interfaceIOInterface
- Returns:
-
-