git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274869 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -68,12 +68,19 @@ import java.text.StringCharacterIterator; | |||||
| * @author Conor MacNeill | * @author Conor MacNeill | ||||
| * @since Ant 1.6 | * @since Ant 1.6 | ||||
| */ | */ | ||||
| public class Locator { | |||||
| public final class Locator { | |||||
| /** | |||||
| * Not instantiable | |||||
| */ | |||||
| private Locator() { | |||||
| } | |||||
| /** | /** | ||||
| * Find the directory or jar file the class has been loaded from. | * Find the directory or jar file the class has been loaded from. | ||||
| * | * | ||||
| * @return null if we cannot determine the location. | |||||
| * @param c the class whose location is required. | |||||
| * @return the file or jar with the class or null if we cannot | |||||
| * determine the location. | |||||
| * | * | ||||
| * @since Ant 1.6 | * @since Ant 1.6 | ||||
| */ | */ | ||||
| @@ -83,9 +90,13 @@ public class Locator { | |||||
| } | } | ||||
| /** | /** | ||||
| * Find the directory or a give resource has been loaded from. | |||||
| * Find the directory or jar a give resource has been loaded from. | |||||
| * | |||||
| * @param c the classloader to be consulted for the source | |||||
| * @param resource the resource whose location is required. | |||||
| * | * | ||||
| * @return null if we cannot determine the location. | |||||
| * @return the file with the resource source or null if | |||||
| * we cannot determine the location. | |||||
| * | * | ||||
| * @since Ant 1.6 | * @since Ant 1.6 | ||||
| */ | */ | ||||
| @@ -102,6 +102,11 @@ public class ScriptDefBase extends Task implements DynamicConfigurator { | |||||
| return definition; | return definition; | ||||
| } | } | ||||
| /** | |||||
| * Create a nested element | |||||
| * | |||||
| * @param name the nested element name | |||||
| */ | |||||
| public Object createDynamicElement(String name) { | public Object createDynamicElement(String name) { | ||||
| List nestedElementList = (List) nestedElementMap.get(name); | List nestedElementList = (List) nestedElementMap.get(name); | ||||
| if (nestedElementList == null) { | if (nestedElementList == null) { | ||||
| @@ -113,6 +118,12 @@ public class ScriptDefBase extends Task implements DynamicConfigurator { | |||||
| return element; | return element; | ||||
| } | } | ||||
| /** | |||||
| * Set a task attribute | |||||
| * | |||||
| * @param name the attribute name. | |||||
| * @param value the attribute's string value | |||||
| */ | |||||
| public void setDynamicAttribute(String name, String value) { | public void setDynamicAttribute(String name, String value) { | ||||
| ScriptDef definition = getScript(); | ScriptDef definition = getScript(); | ||||
| if (!definition.isAttributeSupported(name)) { | if (!definition.isAttributeSupported(name)) { | ||||