1 15 package org.apache.tapestry.binding; 16 17 import org.apache.hivemind.Location; 18 import org.apache.hivemind.util.Defense; 19 import org.apache.tapestry.IComponent; 20 import org.apache.tapestry.coerce.ValueConverter; 21 22 28 public class BeanBinding extends AbstractBinding 29 { 30 private final IComponent _component; 31 32 private final String _beanName; 33 34 public BeanBinding(String description, ValueConverter valueConverter, Location location, 35 IComponent component, String beanName) 36 { 37 super(description, valueConverter, location); 38 39 Defense.notNull(component, "component"); 40 Defense.notNull(beanName, "beanName"); 41 42 _component = component; 43 _beanName = beanName; 44 } 45 46 51 52 public boolean isInvariant() 53 { 54 return false; 55 } 56 57 public Object getComponent() 58 { 59 return _component; 60 } 61 62 public Object getObject() 63 { 64 return _component.getBeans().getBean(_beanName); 65 } 66 67 } | Popular Tags |