Package org.apache.tools.ant.input
Class DefaultInputHandler
- java.lang.Object
- 
- org.apache.tools.ant.input.DefaultInputHandler
 
- 
- All Implemented Interfaces:
- InputHandler
 - Direct Known Subclasses:
- GreedyInputHandler,- SecureInputHandler
 
 public class DefaultInputHandler extends java.lang.Object implements InputHandler Prompts on System.err, reads input from System.in- Since:
- Ant 1.5
 
- 
- 
Constructor SummaryConstructors Constructor Description DefaultInputHandler()Empty no-arg constructor
 - 
Method SummaryModifier and Type Method Description protected java.io.InputStreamgetInputStream()Returns the input stream from which the user input should be read.protected java.lang.StringgetPrompt(InputRequest request)Constructs user prompt from a request.voidhandleInput(InputRequest request)Prompts and requests input.
 
- 
- 
- 
Method Detail- 
handleInputpublic void handleInput(InputRequest request) throws BuildException Prompts and requests input. May loop until a valid input has been entered.- Specified by:
- handleInputin interface- InputHandler
- Parameters:
- request- the request to handle
- Throws:
- BuildException- if not possible to read from console
 
 - 
getPromptprotected java.lang.String getPrompt(InputRequest request) Constructs user prompt from a request.This implementation adds (choice1,choice2,choice3,...) to the prompt for MultipleChoiceInputRequests.- Parameters:
- request- the request to construct the prompt for. Must not be- null.
- Returns:
- the prompt to ask the user
 
 - 
getInputStreamprotected java.io.InputStream getInputStream() Returns the input stream from which the user input should be read.- Returns:
- the input stream from which the user input should be read.
 
 
- 
 
-