Class ShellConsole

    • Field Detail

      • NO_ARG

        private static final java.lang.Class[] NO_ARG
      • BOOLEAN_ARG

        private static final java.lang.Class[] BOOLEAN_ARG
      • STRING_ARG

        private static final java.lang.Class[] STRING_ARG
      • CHARSEQ_ARG

        private static final java.lang.Class[] CHARSEQ_ARG
    • Constructor Detail

      • ShellConsole

        protected ShellConsole()
    • Method Detail

      • getIn

        public abstract java.io.InputStream getIn()
        Returns the underlying InputStream
      • readLine

        public abstract java.lang.String readLine()
                                           throws java.io.IOException
        Reads a single line from the console
        Throws:
        java.io.IOException
      • readLine

        public abstract java.lang.String readLine​(java.lang.String prompt)
                                           throws java.io.IOException
        Reads a single line from the console and sets the console's prompt to prompt
        Throws:
        java.io.IOException
      • flush

        public abstract void flush()
                            throws java.io.IOException
        Flushes the console's output
        Throws:
        java.io.IOException
      • print

        public abstract void print​(java.lang.String s)
                            throws java.io.IOException
        Prints a single string to the console
        Throws:
        java.io.IOException
      • println

        public abstract void println()
                              throws java.io.IOException
        Prints the newline character-sequence to the console
        Throws:
        java.io.IOException
      • println

        public abstract void println​(java.lang.String s)
                              throws java.io.IOException
        Prints a string and the newline character-sequence to the console
        Throws:
        java.io.IOException
      • tryInvoke

        private static java.lang.Object tryInvoke​(java.lang.Object obj,
                                                  java.lang.String method,
                                                  java.lang.Class[] paramTypes,
                                                  java.lang.Object... args)
      • getConsole

        public static ShellConsole getConsole​(java.io.InputStream in,
                                              java.io.PrintStream ps,
                                              java.nio.charset.Charset cs)
        Returns a new ShellConsole which uses the supplied InputStream and PrintStream for its input/output
      • getJLineShellConsoleV1

        private static ShellConsole.JLineShellConsoleV1 getJLineShellConsoleV1​(java.lang.ClassLoader classLoader,
                                                                               java.lang.Class<?> readerClass,
                                                                               Scriptable scope,
                                                                               java.nio.charset.Charset cs)
                                                                        throws java.lang.NoSuchMethodException,
                                                                               java.lang.InstantiationException,
                                                                               java.lang.IllegalAccessException,
                                                                               java.lang.reflect.InvocationTargetException
        Throws:
        java.lang.NoSuchMethodException
        java.lang.InstantiationException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
      • getJLineShellConsoleV2

        private static ShellConsole.JLineShellConsoleV2 getJLineShellConsoleV2​(java.lang.ClassLoader classLoader,
                                                                               java.lang.Class<?> readerClass,
                                                                               Scriptable scope,
                                                                               java.nio.charset.Charset cs)
                                                                        throws java.lang.NoSuchMethodException,
                                                                               java.lang.InstantiationException,
                                                                               java.lang.IllegalAccessException,
                                                                               java.lang.reflect.InvocationTargetException
        Throws:
        java.lang.NoSuchMethodException
        java.lang.InstantiationException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException