FileDocCategorySizeDatePackage
InputRequest.javaAPI DocApache Ant 1.702328Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.input

InputRequest

public class InputRequest extends Object
Encapsulates an input request.
since
Ant 1.5

Fields Summary
private String
prompt
private String
input
private String
defaultValue
Constructors Summary
public InputRequest(String prompt)
Construct an InputRequest.

param
prompt The prompt to show to the user. Must not be null.

        if (prompt == null) {
            throw new IllegalArgumentException("prompt must not be null");
        }

        this.prompt = prompt;
    
Methods Summary
public java.lang.StringgetDefaultValue()
Gets a configured default value.

return
the default value.
since
Ant 1.7.0

        return defaultValue;
    
public java.lang.StringgetInput()
Retrieves the user input.

return
the user input.

        return input;
    
public java.lang.StringgetPrompt()
Retrieves the prompt text.

return
the prompt.

        return prompt;
    
public booleanisInputValid()
Is the user input valid?

return
true if it is.

        return true;
    
public voidsetDefaultValue(java.lang.String d)
Configures a default value.

param
d the value to set.
since
Ant 1.7.0

        defaultValue = d;
    
public voidsetInput(java.lang.String input)
Sets the user provided input.

param
input the string to be used for input.

        this.input = input;