1 7 package org.jboss.test.xml.multispaced.pm.jdbc; 8 9 import org.jboss.logging.Logger; 10 import org.jboss.xb.binding.MarshallingContext; 11 import org.jboss.xb.binding.ObjectModelProvider; 12 13 17 public class JDBCPmMetaDataProvider 18 implements ObjectModelProvider 19 { 20 private static final Logger log = Logger.getLogger(JDBCPmMetaDataFactory.class); 21 22 private final JDBCPm pm; 23 24 public JDBCPmMetaDataProvider(JDBCPm pm) 25 { 26 this.pm = pm; 27 } 28 29 public Object getRoot(Object o, MarshallingContext ctx, String namespaceURI, String localName) 30 { 31 log.debug("getRoot(): o=" + o.getClass()); 32 return pm; 33 } 34 35 public Object getChildren(JDBCPm pm, String namespaceUri, String localName) 36 { 37 log.debug("getChildren> ns=" + namespaceUri + ", localName=" + localName); 38 return null; 39 } 40 41 public Object getElementValue(JDBCPm pm, String namespaceUri, String localName) 42 { 43 log.debug("getValue> ns=" + namespaceUri + ", localName=" + localName); 44 Object child = null; 45 if("datasource".equals(localName)) 46 { 47 child = pm.getDatasource(); 48 } 49 else if("table".equals(localName)) 50 { 51 child = pm.getTable(); 52 } 53 return child; 54 } 55 } 56 | Popular Tags |