1 28 29 package com.caucho.config; 30 31 import com.caucho.config.types.RawString; 32 import com.caucho.util.L10N; 33 import com.caucho.xml.QName; 34 35 import org.w3c.dom.Node ; 36 37 import java.lang.reflect.Method ; 38 import java.util.logging.Logger ; 39 40 43 public class TextAttributeMarshal extends SetterAttributeStrategy { 44 private static final Logger log 45 = Logger.getLogger(TextAttributeMarshal.class.getName()); 46 private static final L10N L = new L10N(TextAttributeMarshal.class); 47 48 private TextAttributeMarshal(Method setter) 49 throws Exception 50 { 51 super(setter); 52 } 53 54 public static SetterAttributeStrategy create(Method setter) 55 throws Exception 56 { 57 Class []param = setter.getParameterTypes(); 58 59 if (RawString.class.equals(param[0])) 60 return new RawTextAttributeMarshal(setter); 61 else 62 return new TextAttributeMarshal(setter); 63 } 64 65 73 public void configure(NodeBuilder builder, 74 Object bean, 75 QName name, 76 Node node) 77 throws Exception 78 { 79 setAttribute(bean, name, builder.configureString(node)); 82 } 83 } 84 | Popular Tags |