Examples of respondsTo()


Examples of com.webobjects.foundation._NSDelegate.respondsTo()

    protected Object perform(String methodName, Object args[], Object defaultResult) {
        Object result = null;
      synchronized (delegates) {
            for (int i = 0; (result == null || result.equals(defaultResult)) && i < delegates.count(); i++) {
                _NSDelegate delegate = (_NSDelegate) delegates.objectAtIndex(i);
                if (delegate.respondsTo(methodName)) {
                    result = delegate.perform(methodName, args);
                }
            }
      }
View Full Code Here

Examples of groovy.lang.MetaClass.respondsTo()

    private static final Object[] EMPTY_OBJECT_ARRAY = {};
   
    static public ReadOnlyProperty getJavaFXProperty(Object instance, String propertyName) {
        MetaClass mc = InvokerHelper.getMetaClass(instance);
        String fxPropertyAccessor = propertyName + "Property";
        if (!mc.respondsTo(instance, fxPropertyAccessor, null).isEmpty()) {
            return (ReadOnlyProperty)InvokerHelper.invokeMethod(instance, fxPropertyAccessor, null);
        }else {
            return null;
        }
    }
View Full Code Here

Examples of groovy.lang.MetaClass.respondsTo()

       
        MetaClass mc = InvokerHelper.getMetaClass(instance);
        MetaProperty metaProperty = mc.getMetaProperty(propertyName);
        if(metaProperty != null) {
            String setterName = MetaProperty.getSetterName(propertyName);
            return !mc.respondsTo(instance, setterName, new Class[]{metaProperty.getType()}).isEmpty();
        } else if(instance instanceof Script) {
            return ((Script)instance).getProperty(propertyName) != null;
        }
        return false;
    }
View Full Code Here

Examples of groovy.lang.MetaClass.respondsTo()

    else if (args.length > 1 && args[args.length -1] instanceof Closure) {
      return invokeBeanDefiningMethod(name, args);
    }
        WebApplicationContext ctx = springConfig.getUnrefreshedApplicationContext();
        MetaClass mc = DefaultGroovyMethods.getMetaClass(ctx);
        if(!mc.respondsTo(ctx, name, args).isEmpty()){
            return mc.invokeMethod(ctx,name, args);
        }
        return this;
  }
View Full Code Here

Examples of groovy.lang.MetaClass.respondsTo()

                PropertyChangeProxyTargetBinding proxytb = new PropertyChangeProxyTargetBinding(newObject, propertyName, listener);

                syntheticFullBinding = syntheticTrigger.createBinding(psb, proxytb);
                syntheticFullBinding.bind();
                updateSet.add(newObject);
            } else if (!mc.respondsTo(newObject, "addPropertyChangeListener", NAME_PARAMS).isEmpty()) {
                InvokerHelper.invokeMethod(newObject, "addPropertyChangeListener", new Object[] {propertyName, listener});
                localListener = listener;
                updateSet.add(newObject);
            } else if (!mc.respondsTo(newObject, "addPropertyChangeListener", GLOBAL_PARAMS).isEmpty()) {
                InvokerHelper.invokeMethod(newObject, "addPropertyChangeListener", listener);
View Full Code Here

Examples of groovy.lang.MetaClass.respondsTo()

                updateSet.add(newObject);
            } else if (!mc.respondsTo(newObject, "addPropertyChangeListener", NAME_PARAMS).isEmpty()) {
                InvokerHelper.invokeMethod(newObject, "addPropertyChangeListener", new Object[] {propertyName, listener});
                localListener = listener;
                updateSet.add(newObject);
            } else if (!mc.respondsTo(newObject, "addPropertyChangeListener", GLOBAL_PARAMS).isEmpty()) {
                InvokerHelper.invokeMethod(newObject, "addPropertyChangeListener", listener);
                globalListener = listener;
                updateSet.add(newObject);
            }
        }
View Full Code Here

Examples of groovy.lang.MetaClass.respondsTo()

                PropertyChangeProxyTargetBinding proxytb = new PropertyChangeProxyTargetBinding(newObject, propertyName, listener);

                syntheticFullBinding = syntheticTrigger.createBinding(psb, proxytb);
                syntheticFullBinding.bind();
                updateSet.add(newObject);
            } else if (!mc.respondsTo(newObject, "addPropertyChangeListener", NAME_PARAMS).isEmpty()) {
                InvokerHelper.invokeMethod(newObject, "addPropertyChangeListener", new Object[] {propertyName, listener});
                localListener = listener;
                updateSet.add(newObject);
            } else if (!mc.respondsTo(newObject, "addPropertyChangeListener", GLOBAL_PARAMS).isEmpty()) {
                InvokerHelper.invokeMethod(newObject, "addPropertyChangeListener", listener);
View Full Code Here

Examples of groovy.lang.MetaClass.respondsTo()

                updateSet.add(newObject);
            } else if (!mc.respondsTo(newObject, "addPropertyChangeListener", NAME_PARAMS).isEmpty()) {
                InvokerHelper.invokeMethod(newObject, "addPropertyChangeListener", new Object[] {propertyName, listener});
                localListener = listener;
                updateSet.add(newObject);
            } else if (!mc.respondsTo(newObject, "addPropertyChangeListener", GLOBAL_PARAMS).isEmpty()) {
                InvokerHelper.invokeMethod(newObject, "addPropertyChangeListener", listener);
                globalListener = listener;
                updateSet.add(newObject);
            }
        }
View Full Code Here

Examples of groovy.lang.MetaClass.respondsTo()

        }
    }

    private void removeBeanDefinition(BeanDefinitionRegistry registry, String beanName) {
        MetaClass mc = GroovySystem.getMetaClassRegistry().getMetaClass(registry.getClass());
        if (!mc.respondsTo(registry, "removeBeanDefinition").isEmpty()) {
            mc.invokeMethod(registry, "removeBeanDefinition", new Object[] { beanName });
        }
    }

    public BeanConfiguration addAbstractBean(String name) {
View Full Code Here

Examples of groovy.lang.MetaClass.respondsTo()

     *
     * @return The result of the method call or null
     */
    public static Object invokeMethodIfExists(Object instance, String methodName, Object[] args) {
        MetaClass metaClass = getMetaClass(instance);
        List<MetaMethod> methodList = metaClass.respondsTo(instance, methodName, args);
        if (methodList != null && !methodList.isEmpty()) {
            return metaClass.invokeMethod(instance, methodName, args);
        }
        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.