nashorn/src/jdk/internal/dynalink/beans/BeansLinker.java
changeset 25252 e8bfc909db53
parent 24778 2ff5d7041566
--- a/nashorn/src/jdk/internal/dynalink/beans/BeansLinker.java	Tue Jul 01 14:27:28 2014 -0700
+++ b/nashorn/src/jdk/internal/dynalink/beans/BeansLinker.java	Wed Jul 02 18:10:31 2014 +0530
@@ -169,6 +169,26 @@
     }
 
     /**
+     * Returns true if the object is a Dynalink Java constructor.
+     *
+     * @param obj the object we want to test for being a constructor
+     * @return true if it is a constructor, false otherwise.
+     */
+    public static boolean isDynamicConstructor(final Object obj) {
+        return obj instanceof DynamicMethod && ((DynamicMethod)obj).isConstructor();
+    }
+
+    /**
+     * Return the dynamic method of constructor of the given class and the given signature.
+     * @param clazz the class
+     * @param signature full signature of the constructor
+     * @return DynamicMethod for the constructor
+     */
+    public static Object getConstructorMethod(final Class<?> clazz, final String signature) {
+        return StaticClassLinker.getConstructorMethod(clazz, signature);
+    }
+
+    /**
      * Returns a collection of names of all readable instance properties of a class.
      * @param clazz the class
      * @return a collection of names of all readable instance properties of a class.