1 15 package org.apache.tapestry.pageload; 16 17 import java.util.Iterator ; 18 19 import org.apache.tapestry.IBinding; 20 import org.apache.tapestry.IComponent; 21 import org.apache.tapestry.spec.IComponentSpecification; 22 23 29 class QueuedInheritInformalBindings implements IQueuedInheritedBinding 30 { 31 private IComponent _component; 32 33 QueuedInheritInformalBindings(IComponent component) 34 { 35 _component = component; 36 } 37 38 public void connect() 39 { 40 41 IComponent container = _component.getContainer(); 42 43 for (Iterator it = container.getBindingNames().iterator(); it.hasNext();) 44 { 45 String bindingName = (String ) it.next(); 46 connectInformalBinding(container, _component, bindingName); 47 } 48 } 49 50 private void connectInformalBinding( 51 IComponent container, 52 IComponent component, 53 String bindingName) 54 { 55 IComponentSpecification componentSpec = component.getSpecification(); 56 IComponentSpecification containerSpec = container.getSpecification(); 57 58 if (component.getBinding(bindingName) != null) 60 return; 61 62 if (componentSpec.getParameter(bindingName) != null 64 || componentSpec.isReservedParameterName(bindingName)) 65 return; 66 67 if (containerSpec.getParameter(bindingName) != null 69 || containerSpec.isReservedParameterName(bindingName)) 70 return; 71 72 IBinding binding = container.getBinding(bindingName); 74 component.setBinding(bindingName, binding); 75 } 76 } | Popular Tags |