Package org.nwolfhub.easycli
Class EasyCLI
java.lang.Object
org.nwolfhub.easycli.EasyCLI
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
ConstructorsConstructorDescriptionEasyCLI()Creates an EasyCLI instance.EasyCLI(boolean overrideStreams) Creates an EasyCLI instance.EasyCLI(InputStream in, PrintStream out) Creates an EasyCLI instance -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddTemplate(String name, Template template) voidaddTemplate(Template template) voidaddTemplate(Template template, String name) voidAdds a new variable to the list of variables processed by the variable processor.voidClears all the variables in the list of variables processed by the variable processor.voidvoiddetectLogLevel(File file) getLevel()getTasks()Returns a list of all variables processed by the variable processor.voidvoidvoidvoidvoidvoidvoidvoidvoidprintAtLevel(Class<?> template, Level level, String text) voidprintAtLevel(String text, String template, Level level) voidprintAtLevel(String text, Level level) voidprintAtLevel(String text, Level level, Class<?> template) voidprintAtLevel(String template, Level level, Object... objects) voidprintAtLevel(String text, Template template, Level level) voidprintAtLevel(Level level, Object... objects) voidprintAtLevel(Template template, Level level, Object... objects) voidremoveTask(String command) voidremoveTemplate(String name) voidremoveVariable(int index) Removes the variable at the specified index from the list of variables processed by the variable processor.setActiveTemplate(String activeTemplate) voidvoid
-
Field Details
-
activeTemplate
-
level
-
commandNotFoundText
-
printNotFoundText
-
-
Constructor Details
-
EasyCLI
Creates an EasyCLI instance- Parameters:
in- - input stream to read infoout- - 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
-
addTemplate
-
addTemplate
-
removeTemplate
-
getTemplates
-
addTask
-
removeTask
-
getTasks
-
getActiveTemplate
-
setActiveTemplate
-
getLevel
-
setLevel
-
detectLogLevel
- Throws:
IOException
-
detectLogLevel
- Throws:
IOException
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-
printAtLevel
-
printAtLevel
-
printAtLevel
-
printAtLevel
-
printAtLevel
-
printAtLevel
-
printAtLevel
-
printAtLevel
-
addVariable
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
Returns a list of all variables processed by the variable processor.- Returns:
- a list of Variable objects
-