public void registerExplicitMethod(String name, String groupName, Closure closure) { // set the delegate to FBS so the closure closes over the builder closure.setDelegate(this); explicitMethods.put(name, closure); getRegistrationGroup(groupName).add(name); }
public void registerExplicitProperty(String name, String groupName, Closure getter, Closure setter) { // set the delegate to FBS so the closure closes over the builder if (getter != null) getter.setDelegate(this); if (setter != null) setter.setDelegate(this); explicitProperties.put(name, new Closure[]{getter, setter}); String methodNameBase = MetaClassHelper.capitalize(name); if (getter != null) { getRegistrationGroup(groupName).add("get" + methodNameBase); } if (setter != null) { getRegistrationGroup(groupName).add("set" + methodNameBase); } }
/** * Registers a factory for a node name. * * @param name the name of the node * @param groupName thr group to register this node in * @param factory the factory to return the values */ public void registerFactory(String name, String groupName, Factory factory) { getProxyBuilder().factories.put(name, factory); getRegistrationGroup(groupName).add(name); factory.onFactoryRegistration(this, name, groupName); }
/** * Registers a factory for a JavaBean.<br> * The JavaBean class should have a no-args constructor. * * @param theName name of the node * @param groupName thr group to register this node in * @param beanClass the factory to handle the name */ public void registerBeanFactory(String theName, String groupName, final Class beanClass) { getProxyBuilder().registerFactory(theName, new AbstractFactory() { public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map properties) throws InstantiationException, IllegalAccessException { if (checkValueIsTypeNotString(value, name, beanClass)) { return value; } else { return beanClass.newInstance(); } } }); getRegistrationGroup(groupName).add(theName); }
public void registerExplicitMethod(String name, String groupName, Closure closure) { // set the delegate to FBS so the closure closes over the builder closure.setDelegate(this); explicitMethods.put(name, closure); getRegistrationGroup(groupName).add(name); }
public void registerExplicitMethod(String name, String groupName, Closure closure) { // set the delegate to FBS so the closure closes over the builder closure.setDelegate(this); explicitMethods.put(name, closure); getRegistrationGroup(groupName).add(name); }
public void registerExplicitProperty(String name, String groupName, Closure getter, Closure setter) { // set the delegate to FBS so the closure closes over the builder if (getter != null) getter.setDelegate(this); if (setter != null) setter.setDelegate(this); explicitProperties.put(name, new Closure[]{getter, setter}); String methodNameBase = MetaClassHelper.capitalize(name); if (getter != null) { getRegistrationGroup(groupName).add("get" + methodNameBase); } if (setter != null) { getRegistrationGroup(groupName).add("set" + methodNameBase); } }
public void registerExplicitProperty(String name, String groupName, Closure getter, Closure setter) { // set the delegate to FBS so the closure closes over the builder if (getter != null) getter.setDelegate(this); if (setter != null) setter.setDelegate(this); explicitProperties.put(name, new Closure[]{getter, setter}); String methodNameBase = MetaClassHelper.capitalize(name); if (getter != null) { getRegistrationGroup(groupName).add("get" + methodNameBase); } if (setter != null) { getRegistrationGroup(groupName).add("set" + methodNameBase); } }
/** * Registers a factory for a node name. * * @param name the name of the node * @param groupName thr group to register this node in * @param factory the factory to return the values */ public void registerFactory(String name, String groupName, Factory factory) { getProxyBuilder().factories.put(name, factory); getRegistrationGroup(groupName).add(name); factory.onFactoryRegistration(this, name, groupName); }
/** * Registers a factory for a node name. * * @param name the name of the node * @param groupName thr group to register this node in * @param factory the factory to return the values */ public void registerFactory(String name, String groupName, Factory factory) { getProxyBuilder().factories.put(name, factory); getRegistrationGroup(groupName).add(name); factory.onFactoryRegistration(this, name, groupName); }
/** * Registers a factory for a JavaBean.<br> * The JavaBean class should have a no-args constructor. * * @param theName name of the node * @param groupName thr group to register this node in * @param beanClass the factory to handle the name */ public void registerBeanFactory(String theName, String groupName, final Class beanClass) { getProxyBuilder().registerFactory(theName, new AbstractFactory() { public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map properties) throws InstantiationException, IllegalAccessException { if (checkValueIsTypeNotString(value, name, beanClass)) { return value; } else { return beanClass.newInstance(); } } }); getRegistrationGroup(groupName).add(theName); }
/** * Registers a factory for a JavaBean.<br> * The JavaBean class should have a no-args constructor. * * @param theName name of the node * @param groupName thr group to register this node in * @param beanClass the factory to handle the name */ public void registerBeanFactory(String theName, String groupName, final Class beanClass) { getProxyBuilder().registerFactory(theName, new AbstractFactory() { public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map properties) throws InstantiationException, IllegalAccessException { if (checkValueIsTypeNotString(value, name, beanClass)) { return value; } else { return beanClass.newInstance(); } } }); getRegistrationGroup(groupName).add(theName); }