Methods Summary |
---|
public void | addText(java.lang.String msg)Set a multiline message.
if (messageAttribute && "".equals(msg.trim())) {
return;
}
message += getProject().replaceProperties(msg);
|
public org.apache.tools.ant.taskdefs.Input$Handler | createHandler()Create a nested handler element.
if (handler != null) {
throw new BuildException(
"Cannot define > 1 nested input handler");
}
handler = new Handler();
return handler;
|
public void | execute()Actual method executed by ant.
if (addproperty != null
&& getProject().getProperty(addproperty) != null) {
log("skipping " + getTaskName() + " as property " + addproperty
+ " has already been set.");
return;
}
InputRequest request = null;
if (validargs != null) {
Vector accept = StringUtils.split(validargs, ',");
request = new MultipleChoiceInputRequest(message, accept);
} else {
request = new InputRequest(message);
}
request.setDefaultValue(defaultvalue);
InputHandler h = handler == null
? getProject().getInputHandler()
: handler.getInputHandler();
h.handleInput(request);
String value = request.getInput();
if ((value == null || value.trim().length() == 0)
&& defaultvalue != null) {
value = defaultvalue;
}
if (addproperty != null && value != null) {
getProject().setNewProperty(addproperty, value);
}
|
public void | setAddproperty(java.lang.String addproperty)Defines the name of a property to be created from input. Behaviour is
according to property task which means that existing properties
cannot be overridden.
this.addproperty = addproperty;
|
public void | setDefaultvalue(java.lang.String defaultvalue)Defines the default value of the property to be created from input.
Property value will be set to default if not input is received.
this.defaultvalue = defaultvalue;
|
public void | setMessage(java.lang.String message)Sets the Message which gets displayed to the user during the build run.
this.message = message;
messageAttribute = true;
|
public void | setValidargs(java.lang.String validargs)Defines valid input parameters as comma separated strings. If set, input
task will reject any input not defined as accepted and requires the user
to reenter it. Validargs are case sensitive. If you want 'a' and 'A' to
be accepted you need to define both values as accepted arguments.
this.validargs = validargs;
|