conor 2003/02/11 05:41:33
Modified: src/main/org/apache/tools/ant IntrospectionHelper.java UnknownElement.java Log: Allow TaskContainers to have nested elements which take precedence over tasks Revision Changes Path 1.47 +13 -1 ant/src/main/org/apache/tools/ant/IntrospectionHelper.java Index: IntrospectionHelper.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/IntrospectionHelper.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -w -u -r1.46 -r1.47 --- IntrospectionHelper.java 10 Feb 2003 14:13:30 -0000 1.46 +++ IntrospectionHelper.java 11 Feb 2003 13:41:33 -0000 1.47 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2000-2002 The Apache Software Foundation. All rights + * Copyright (c) 2000-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -563,6 +563,18 @@ } } + /** + * Indicate if this element supports a nested element of the + * given name. + * + * @param elementName the name of the nested element being checked + * + * @return true if the given nested element is supported + */ + public boolean supportsNestedElement(String elementName) { + return nestedCreators.containsKey(elementName); + } + /** * Stores a named nested element using a storage method determined * by the initial introspection. If no appropriate storage method 1.40 +4 -5 ant/src/main/org/apache/tools/ant/UnknownElement.java Index: UnknownElement.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/UnknownElement.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -w -u -r1.39 -r1.40 --- UnknownElement.java 10 Feb 2003 14:13:30 -0000 1.39 +++ UnknownElement.java 11 Feb 2003 13:41:33 -0000 1.40 @@ -269,10 +269,8 @@ UnknownElement child = (UnknownElement) children.elementAt(i); Object realChild = null; - if (parent instanceof TaskContainer) { - //ProjectComponentHelper helper=ProjectComponentHelper.getProjectComponentHelper(); - //realChild = helper.createProjectComponent( child, getProject(), null, - // child.getTag()); + if (!ih.supportsNestedElement(child.getTag()) + && parent instanceof TaskContainer) { realChild = makeTask(child, childWrapper, false); if (realChild == null) { @@ -296,7 +294,8 @@ } childWrapper.setProxy(realChild); - if (parent instanceof TaskContainer) { + if (parent instanceof TaskContainer + && realChild instanceof Task) { ((Task) realChild).setRuntimeConfigurableWrapper(childWrapper); }