Class EasyCLI

java.lang.Object
org.nwolfhub.easycli.EasyCLI

public class EasyCLI extends Object
  • Field Details

    • activeTemplate

      public String activeTemplate
    • level

      public Level level
    • commandNotFoundText

      public String commandNotFoundText
    • printNotFoundText

      public Boolean printNotFoundText
  • Constructor Details

    • EasyCLI

      public EasyCLI(InputStream in, PrintStream out)
      Creates an EasyCLI instance
      Parameters:
      in - - input stream to read info
      out - - output stream
    • EasyCLI

      public EasyCLI()
      Creates an EasyCLI instance. Uses System streams
    • EasyCLI

      public EasyCLI(boolean overrideStreams)
      Creates an EasyCLI instance. Uses System streams
      Parameters:
      overrideStreams - - will override system streams and disallow printing in them. ErrorStream won't be overridden
  • Method Details

    • stopListening

      public void stopListening()
    • startListening

      public void startListening()
    • addTemplate

      public void addTemplate(Template template)
    • addTemplate

      public void addTemplate(Template template, String name)
    • addTemplate

      public void addTemplate(String name, Template template)
    • removeTemplate

      public void removeTemplate(String name)
    • getTemplates

      public List<Template> getTemplates()
    • addTask

      public void addTask(String command, InputTask task)
    • removeTask

      public void removeTask(String command)
    • getTasks

      public List<InputTask> getTasks()
    • getActiveTemplate

      public String getActiveTemplate()
    • setActiveTemplate

      public EasyCLI setActiveTemplate(String activeTemplate)
    • getLevel

      public Level getLevel()
    • setLevel

      public EasyCLI setLevel(Level level)
    • detectLogLevel

      public void detectLogLevel() throws IOException
      Throws:
      IOException
    • detectLogLevel

      public void detectLogLevel(File file) throws IOException
      Throws:
      IOException
    • print

      public void print(String text, String template)
    • print

      public void print(String text, Template template)
    • print

      public void print(String text)
    • print

      public void print(Object... objects)
    • print

      public void print(Template template, Object... objects)
    • print

      public void print(String template, Object... objects)
    • print

      public void print(Class<?> template, String text)
    • print

      public void print(String text, Class<?> template)
    • printAtLevel

      public void printAtLevel(String text, String template, Level level)
    • printAtLevel

      public void printAtLevel(String text, Template template, Level level)
    • printAtLevel

      public void printAtLevel(String text, Level level)
    • printAtLevel

      public void printAtLevel(Level level, Object... objects)
    • printAtLevel

      public void printAtLevel(Template template, Level level, Object... objects)
    • printAtLevel

      public void printAtLevel(String template, Level level, Object... objects)
    • printAtLevel

      public void printAtLevel(Class<?> template, Level level, String text)
    • printAtLevel

      public void printAtLevel(String text, Level level, Class<?> template)
    • addVariable

      public void addVariable(Variable v)
      Adds a new variable to the list of variables processed by the variable processor.
      Parameters:
      v - the variable to be added
    • removeVariable

      public void removeVariable(int index)
      Removes the variable at the specified index from the list of variables processed by the variable processor.
      Parameters:
      index - the index of the variable to be removed
    • clearVariables

      public void clearVariables()
      Clears all the variables in the list of variables processed by the variable processor.
    • getVariables

      public List<Variable> getVariables()
      Returns a list of all variables processed by the variable processor.
      Returns:
      a list of Variable objects