JavaXT
|
|||||||||
Console ClassVarious command line utilities used to print debug messages and collect user inputs.
ConstructorsThere are no public constructors.Propertiesconsole Static instance of the this class that can be called directly via a static import. Example:
import static javaxt.utils.Console.console; public class Test { public Test(){ console.log("Hello!"); } } Public Methodslog( Object... any ) returns void Prints a message to the standard output stream, along with the class name and line number where the log() function is called. This function is intended to help debug applications and is inspired by the JavaScript console.log() function.
Static MethodsgetPassword( String prompt ) returns String Used to prompt a user for a password. The password is hidden as is it entered. parseArgs( String[] args ) returns HashMap<String, String> Converts command line inputs into key/value pairs. Assumes keys start with a "-" character (e.g. "-version" or "--version") followed by a value (or nothing at all). getValue( HashMap<String, String> args, String ...keys ) returns Value Returns a value for a given set of command line arguments
main( String[] args ) returns void Used to print the JavaXT version number when this jar is called from the command line. Example:
java -jar javaxt-core.jar JavaXT: 1.11.3Under the hood, this simple command line application uses the getVersion() method in the javaxt.io.Jar class. |