org.apache.tools.ant.input

Class InputRequest

Known Direct Subclasses:
MultipleChoiceInputRequest

public class InputRequest
extends java.lang.Object

Encapsulates an input request.
Since:
Ant 1.5

Constructor Summary

InputRequest(String prompt)
Construct an InputRequest.

Method Summary

String
getDefaultValue()
Gets a configured default value.
String
getInput()
Retrieves the user input.
String
getPrompt()
Retrieves the prompt text.
boolean
isInputValid()
Is the user input valid?
void
setDefaultValue(String d)
Configures a default value.
void
setInput(String input)
Sets the user provided input.

Constructor Details

InputRequest

public InputRequest(String prompt)
Construct an InputRequest.
Parameters:
prompt - The prompt to show to the user. Must not be null.

Method Details

getDefaultValue

public String getDefaultValue()
Gets a configured default value.
Returns:
the default value.
Since:
Ant 1.7.0

getInput

public String getInput()
Retrieves the user input.
Returns:
the user input.

getPrompt

public String getPrompt()
Retrieves the prompt text.
Returns:
the prompt.

isInputValid

public boolean isInputValid()
Is the user input valid?
Returns:
true if it is.

setDefaultValue

public void setDefaultValue(String d)
Configures a default value.
Parameters:
d - the value to set.
Since:
Ant 1.7.0

setInput

public void setInput(String input)
Sets the user provided input.
Parameters:
input - the string to be used for input.