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

MultipleChoiceInputRequest

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

Fields Summary
private Vector
choices
Constructors Summary
public MultipleChoiceInputRequest(String prompt, Vector choices)

param
prompt The prompt to show to the user. Must not be null.
param
choices holds all input values that are allowed. Must not be null.


                                                   
         
        super(prompt);
        if (choices == null) {
            throw new IllegalArgumentException("choices must not be null");
        }
        this.choices = choices;
    
Methods Summary
public java.util.VectorgetChoices()

return
The possible values.

        return choices;
    
public booleanisInputValid()

return
true if the input is one of the allowed values.

        return choices.contains(getInput()) || ("".equals(getInput()) && getDefaultValue() != null);