Methods Summary |
---|
public void | addText(java.lang.String text)Set the script text.
this.text = getProject().replaceProperties(text);
|
public java.lang.Object | createDynamicElement(java.lang.String name)Create a nested element
List nestedElementList = (List) nestedElementMap.get(name);
if (nestedElementList == null) {
nestedElementList = new ArrayList();
nestedElementMap.put(name, nestedElementList);
}
Object element = getScript().createNestedElement(name);
nestedElementList.add(element);
return element;
|
public void | execute()Locate the script defining task and execute the script by passing
control to it
getScript().executeScript(attributes, nestedElementMap, this);
|
public void | fail(java.lang.String message)Utility method for nested scripts; throws a BuildException
with the given message.
throw new BuildException(message);
|
private ScriptDef | getScript()
String name = getTaskType();
Map scriptRepository
= (Map) getProject().getReference(MagicNames.SCRIPT_REPOSITORY);
if (scriptRepository == null) {
throw new BuildException("Script repository not found for " + name);
}
ScriptDef definition = (ScriptDef) scriptRepository.get(getTaskType());
if (definition == null) {
throw new BuildException("Script definition not found for " + name);
}
return definition;
|
public java.lang.String | getText()get the text of this element; may be null
return text;
|
public void | setDynamicAttribute(java.lang.String name, java.lang.String value)Set a task attribute
ScriptDef definition = getScript();
if (!definition.isAttributeSupported(name)) {
throw new BuildException("<" + getTaskType()
+ "> does not support the \"" + name + "\" attribute");
}
attributes.put(name, value);
|