1 28 29 package com.caucho.config; 30 31 import com.caucho.xml.QName; 32 33 import org.w3c.dom.Node ; 34 35 import java.lang.reflect.Method ; 36 37 40 public class QNameMapAttributeStrategy extends AttributeStrategy { 41 private final Method _setter; 42 private final TypeStrategy _typeStrategy; 43 private final QName _name; 44 45 public QNameMapAttributeStrategy(Method setter, QName name) 46 throws Exception 47 { 48 _setter = setter; 49 _name = name; 50 51 Class []param = setter.getParameterTypes(); 52 53 _typeStrategy = TypeStrategyFactory.getTypeStrategy(param[1]); 54 } 55 56 65 public void configure(NodeBuilder builder, Object bean, QName name, Node node) 66 throws Exception 67 { 68 _setter.invoke(bean, _name, _typeStrategy.configure(builder, node, bean)); 69 } 70 } 71 | Popular Tags |