1 7 package org.jboss.test.xml.multispaced.pm.jdbc; 8 9 import org.jboss.xb.binding.UnmarshallingContext; 10 import org.jboss.xb.binding.ObjectModelFactory; 11 import org.xml.sax.Attributes ; 12 13 17 public class JDBCPmMetaDataFactory 18 implements ObjectModelFactory 19 { 20 public static final JDBCPmMetaDataFactory INSTANCE = new JDBCPmMetaDataFactory(); 21 22 private JDBCPmMetaDataFactory() 23 { 24 } 25 26 public Object completeRoot(Object root, UnmarshallingContext ctx, 27 String uri, String name) 28 { 29 return root; 30 } 31 32 public Object newRoot(Object root, 33 UnmarshallingContext navigator, 34 String namespaceURI, 35 String localName, 36 Attributes attrs) 37 { 38 return new JDBCPm(); 39 } 40 41 public void setValue(JDBCPm pm, UnmarshallingContext navigator, String namespaceUri, String localName, String value) 42 { 43 if("datasource".equals(localName)) 44 { 45 pm.setDatasource(value); 46 } 47 else if("table".equals(localName)) 48 { 49 pm.setTable(value); 50 } 51 } 52 } 53 | Popular Tags |