KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > xml > multispaced > pm > jdbc > JDBCPmMetaDataFactory


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

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 JavaDoc;
12
13 /**
14  * @author <a HREF="mailto:alex@jboss.org">Alexey Loubyansky</a>
15  * @version <tt>$Revision: 1.3.2.3 $</tt>
16  */

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 JavaDoc completeRoot(Object JavaDoc root, UnmarshallingContext ctx,
27          String JavaDoc uri, String JavaDoc name)
28    {
29       return root;
30    }
31
32    public Object JavaDoc newRoot(Object JavaDoc root,
33                          UnmarshallingContext navigator,
34                          String JavaDoc namespaceURI,
35                          String JavaDoc localName,
36                          Attributes JavaDoc attrs)
37    {
38       return new JDBCPm();
39    }
40
41    public void setValue(JDBCPm pm, UnmarshallingContext navigator, String JavaDoc namespaceUri, String JavaDoc localName, String JavaDoc 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