1 20 package org.apache.beehive.wsm.axis.databinding; 21 22 import java.util.ArrayList ; 23 import java.util.List ; 24 25 import javax.xml.namespace.QName ; 26 import javax.xml.rpc.encoding.XMLType ; 27 28 import org.apache.beehive.wsm.databinding.BindingLookupService; 29 import org.apache.beehive.wsm.databinding.xmlbeans.XmlBeanTypeLookup; 30 31 32 public class SystemTypeLookupService implements BindingLookupService { 33 34 List <BindingLookupService> lookupServiceList = new ArrayList <BindingLookupService>(); 35 36 39 public SystemTypeLookupService() { 40 lookupServiceList.add(new XmlBeanTypeLookup()); 41 lookupServiceList.add(new AxisTypeLookup()); 42 43 } 44 45 50 public QName class2qname(Class cls) { 51 QName qname = null; 52 53 for (BindingLookupService lookUpService : lookupServiceList) { 54 if (null != (qname = lookUpService.class2qname(cls))) 55 break; 56 } 57 return qname; 58 } 59 60 65 public QName class2qname(Class cls, String namespace) { 66 QName qname = null; 67 68 for (BindingLookupService lookUpService : lookupServiceList) { 69 if (null != (qname = lookUpService.class2qname(cls, namespace))) 70 break; 71 } 72 return qname; 73 } 74 75 80 public Class qname2class(QName qname) { 81 Class cls = null; 82 for (BindingLookupService lookUpService : lookupServiceList) { 83 if (null != (cls = lookUpService.qname2class(qname))) 84 break; 85 } 86 if (null == cls) 87 cls = Object .class; 88 return cls; 89 } 90 91 } 92 | Popular Tags |