You can use reflection to test if a method exists.
For example if you have an object foo, you can get all the methods declared in the class of that object in the following:
Method[] methods = foo.getClass().getMethods();
This returns an array of the methods declared in the class.
Then just use a for loop to check if a specific method exists in the array returned
for (Method m : methods)
{
if (m.getName().equals(someString))
{
//do something
}
}
someString is the name of the method you're looking for, which is "isPointMarkCreationAllowed" in your case.
Use the following site to learn about reflections in Java
http://docs.oracle.com/javase/tutorial/reflect/member/methodType.html
win.eval("isPointMarkCreationAllowed()");What happens when you call that and the function does not exist? I would expect aJSExceptionaccording to the JavaDocs.