1 29 30 package com.caucho.config.jaxb; 31 32 import com.caucho.config.AttributeStrategy; 33 import com.caucho.config.ConfigException; 34 import com.caucho.config.NodeBuilder; 35 import com.caucho.config.TypeStrategy; 36 import com.caucho.xml.QName; 37 38 import org.w3c.dom.Node ; 39 40 import java.util.HashMap ; 41 import java.util.List ; 42 43 public class CollectionWrapperType extends TypeStrategy { 44 private HashMap <String ,AttributeStrategy> _attributeMap 45 = new HashMap <String ,AttributeStrategy>(); 46 47 public CollectionWrapperType() 48 { 49 } 50 51 HashMap <String ,AttributeStrategy> getAttributeMap() 52 { 53 return _attributeMap; 54 } 55 56 59 public Class getType() 60 { 61 return List .class; 62 } 63 64 67 public String getTypeName() 68 { 69 return getType().getName(); 70 } 71 72 79 public Object configure(NodeBuilder builder, Node node, Object parent) 80 throws Exception 81 { 82 configureBean(builder, parent, node); 83 84 return parent; 85 } 86 87 94 public AttributeStrategy getAttributeStrategy(QName attrName) 95 throws Exception 96 { 97 AttributeStrategy strategy = _attributeMap.get(attrName.getLocalName()); 98 99 if (strategy != null) 100 return strategy; 101 102 return strategy; 103 } 104 } 105 | Popular Tags |