Browse Source

add a method to see if a nested element is supported via reflection

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@573642 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
3426002af9
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      src/main/org/apache/tools/ant/IntrospectionHelper.java

+ 14
- 0
src/main/org/apache/tools/ant/IntrospectionHelper.java View File

@@ -647,6 +647,20 @@ public final class IntrospectionHelper {
if (isDynamic() || addTypeMethods.size() > 0) {
return true;
}
return supportsReflectElement(parentUri, elementName);
}

/**
* Check if this element supports a nested element from refection.
*
* @param parentUri the uri of the parent
* @param elementName the name of the nested element being checked
*
* @return true if the given nested element is supported
* @since Ant 1.8.0
*/
public boolean supportsReflectElement(
String parentUri, String elementName) {
String name = ProjectHelper.extractNameFromComponentName(elementName);
if (!nestedCreators.containsKey(name.toLowerCase(Locale.US))) {
return false;


Loading…
Cancel
Save