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 PrimitivePropertyStrategy extends AttributeStrategy { 41 private final Method _setter; 42 private final TypeStrategy _typeStrategy; 43 private final String _name; 44 45 public PrimitivePropertyStrategy(Method setter, String 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 |