1 15 package org.apache.tapestry.form.translator; 16 17 import org.apache.hivemind.ApplicationRuntimeException; 18 import org.apache.hivemind.Location; 19 import org.apache.hivemind.lib.BeanFactory; 20 import org.apache.tapestry.IBinding; 21 import org.apache.tapestry.IComponent; 22 import org.apache.tapestry.binding.AbstractBindingFactory; 23 24 32 public class TranslatorBindingFactory extends AbstractBindingFactory 33 { 34 private BeanFactory _translatorBeanFactory; 35 36 public IBinding createBinding(IComponent root, String bindingDescription, String path, 37 Location location) 38 { 39 try 40 { 41 Translator translator = (Translator) _translatorBeanFactory.get(path); 42 43 return new TranslatorBinding(bindingDescription, getValueConverter(), location, 44 translator); 45 } 46 catch (Exception ex) 47 { 48 throw new ApplicationRuntimeException(ex.getMessage(), location, ex); 49 } 50 } 51 52 public void setTranslatorBeanFactory(BeanFactory translatorBeanFactory) 53 { 54 _translatorBeanFactory = translatorBeanFactory; 55 } 56 } 57 | Popular Tags |