/** * Assigns any existing properties to the node.<br> * It will call attributeDelegates before passing control to the factory * that built the node. * * @param node the object returned by tne node factory * @param attributes the attributes for the node */ protected void handleNodeAttributes(Object node, Map attributes) { // first, short circuit if (node == null) { return; } for (Closure attrDelegate : getProxyBuilder().getAttributeDelegates()) { FactoryBuilderSupport builder = this; if (attrDelegate.getOwner() instanceof FactoryBuilderSupport) { builder = (FactoryBuilderSupport) attrDelegate.getOwner(); } else if (attrDelegate.getDelegate() instanceof FactoryBuilderSupport) { builder = (FactoryBuilderSupport) attrDelegate.getDelegate(); } attrDelegate.call(builder, node, attributes); } if (getProxyBuilder().getCurrentFactory().onHandleNodeAttributes(getProxyBuilder().getChildBuilder(), node, attributes)) { getProxyBuilder().setNodeAttributes(node, attributes); } }
/** * Assigns any existing properties to the node.<br> * It will call attributeDelegates before passing control to the factory * that built the node. */ protected void handleNodeAttributes( Object node, Map attributes ) { // first, short circuit if( node == null ){ return; } for( Iterator iter = proxyBuilder.attributeDelegates.iterator(); iter.hasNext(); ){ ((Closure) iter.next()).call( new Object[] { this, node, attributes } ); } if( proxyBuilder.getCurrentFactory().onHandleNodeAttributes( this, node, attributes ) ){ proxyBuilder.setNodeAttributes( node, attributes ); } }
/** * Assigns any existing properties to the node.<br> * It will call attributeDelegates before passing control to the factory * that built the node. * * @param node the object returned by tne node factory * @param attributes the attributes for the node */ protected void handleNodeAttributes(Object node, Map attributes) { // first, short circuit if (node == null) { return; } for (Closure attrDelegate : getProxyBuilder().attributeDelegates) { FactoryBuilderSupport builder = this; if (attrDelegate.getOwner() instanceof FactoryBuilderSupport) { builder = (FactoryBuilderSupport) attrDelegate.getOwner(); } else if (attrDelegate.getDelegate() instanceof FactoryBuilderSupport) { builder = (FactoryBuilderSupport) attrDelegate.getDelegate(); } attrDelegate.call(new Object[]{builder, node, attributes}); } if (getProxyBuilder().getCurrentFactory().onHandleNodeAttributes(getProxyBuilder().getChildBuilder(), node, attributes)) { getProxyBuilder().setNodeAttributes(node, attributes); } }
/** * Assigns any existing properties to the node.<br> * It will call attributeDelegates before passing control to the factory * that built the node. * * @param node the object returned by tne node factory * @param attributes the attributes for the node */ protected void handleNodeAttributes(Object node, Map attributes) { // first, short circuit if (node == null) { return; } for (Closure attrDelegate : getProxyBuilder().attributeDelegates) { FactoryBuilderSupport builder = this; if (attrDelegate.getOwner() instanceof FactoryBuilderSupport) { builder = (FactoryBuilderSupport) attrDelegate.getOwner(); } else if (attrDelegate.getDelegate() instanceof FactoryBuilderSupport) { builder = (FactoryBuilderSupport) attrDelegate.getDelegate(); } attrDelegate.call(new Object[]{builder, node, attributes}); } if (getProxyBuilder().getCurrentFactory().onHandleNodeAttributes(getProxyBuilder().getChildBuilder(), node, attributes)) { getProxyBuilder().setNodeAttributes(node, attributes); } }
/** * Assigns any existing properties to the node.<br> * It will call attributeDelegates before passing control to the factory * that built the node. * * @param node the object returned by tne node factory * @param attributes the attributes for the node */ protected void handleNodeAttributes(Object node, Map attributes) { // first, short circuit if (node == null) { return; } for (Closure attrDelegate : getProxyBuilder().getAttributeDelegates()) { FactoryBuilderSupport builder = this; if (attrDelegate.getOwner() instanceof FactoryBuilderSupport) { builder = (FactoryBuilderSupport) attrDelegate.getOwner(); } else if (attrDelegate.getDelegate() instanceof FactoryBuilderSupport) { builder = (FactoryBuilderSupport) attrDelegate.getDelegate(); } attrDelegate.call(new Object[]{builder, node, attributes}); } if (getProxyBuilder().getCurrentFactory().onHandleNodeAttributes(getProxyBuilder().getChildBuilder(), node, attributes)) { getProxyBuilder().setNodeAttributes(node, attributes); } }