1 29 30 package com.caucho.config; 31 32 import com.caucho.util.L10N; 33 import com.caucho.xml.QName; 34 35 import org.w3c.dom.Node ; 36 37 public class EnvironmentAttributeStrategy extends AttributeStrategy { 38 static final L10N L = new L10N(EnvironmentAttributeStrategy.class); 39 40 private final TypeStrategy _typeStrategy; 41 42 public EnvironmentAttributeStrategy(TypeStrategy typeStrategy) 43 { 44 _typeStrategy = typeStrategy; 45 } 46 47 public void configure(NodeBuilder builder, Object bean, 48 QName name, Node node) 49 throws Exception 50 { 51 Object child = builder.createResinType(node); 53 54 if (child == null) 55 child = _typeStrategy.create(); 56 57 if (child != null) { 58 _typeStrategy.setParent(child, bean); 59 60 builder.configureImpl(_typeStrategy, child, node); 61 } 62 else 63 builder.configureChildImpl(_typeStrategy, node, bean); 64 } 65 66 public String toString() 67 { 68 return "EnvironmentAttributeStrategy[" + _typeStrategy + "]"; 69 } 70 } 71 | Popular Tags |