1 package org.codehaus.groovy.sandbox.ui; 2 3 import java.io.InputStream ; 4 import java.io.PrintStream ; 5 6 13 public class PromptFactory 14 { 15 public static Prompt buildPrompt(InputStream in, PrintStream out, PrintStream err) 16 { 17 try 18 { 19 return (Prompt) Class.forName("org.codehaus.groovy.sandbox.ui.ReadlinePrompt").newInstance(); 20 } 21 catch (ClassNotFoundException e) 22 { 23 return new JavaPrompt(in, out, err); 24 } 25 catch (Exception e) 26 { 27 e.printStackTrace(); 28 return new JavaPrompt(in, out, err); 29 } 30 } 31 } 32 | Popular Tags |