MCPcopy Create free account
hub / github.com/cbeust/jcommander / getConsole

Method getConsole

src/main/java/com/beust/jcommander/JCommander.java:295–306  ·  view source on GitHub ↗

@return a wrapper for a java.io.PrintStream, typically System#out.

()

Source from the content-addressed store, hash-verified

293 * @return a wrapper for a {@link java.io.PrintStream}, typically {@link System#out}.
294 */
295 public synchronized Console getConsole() {
296 if (console == null) {
297 try {
298 Method consoleMethod = System.class.getDeclaredMethod("console");
299 Object console = consoleMethod.invoke(null);
300 this.console = new JDK6Console(console);
301 } catch (Throwable t) {
302 console = new DefaultConsole();
303 }
304 }
305 return console;
306 }
307
308 /**
309 * Adds the provided arg object to the set of objects that this commander

Callers 5

readPasswordMethod · 0.95
usageMethod · 0.95
pMethod · 0.95
pMethod · 0.80
usageMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected