From 3426002af9a852d277a4d188d89d84cb73112ea0 Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Fri, 7 Sep 2007 17:52:29 +0000 Subject: [PATCH] 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 --- .../org/apache/tools/ant/IntrospectionHelper.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/org/apache/tools/ant/IntrospectionHelper.java b/src/main/org/apache/tools/ant/IntrospectionHelper.java index 142fc5b97..7a99d90b7 100644 --- a/src/main/org/apache/tools/ant/IntrospectionHelper.java +++ b/src/main/org/apache/tools/ant/IntrospectionHelper.java @@ -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;