KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > pm > generator > jdbc > JdbcComplexTypeSG


1 /*
2  * Copyright 2003, 2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15
16  */

17 package org.apache.ws.jaxme.pm.generator.jdbc;
18
19 import org.apache.ws.jaxme.generator.sg.ComplexTypeSG;
20 import org.apache.ws.jaxme.generator.sg.ComplexTypeSGChain;
21 import org.apache.ws.jaxme.generator.sg.impl.ComplexTypeSGChainImpl;
22 import org.apache.ws.jaxme.xs.XSType;
23 import org.apache.ws.jaxme.xs.impl.XSUtil;
24 import org.xml.sax.SAXException JavaDoc;
25
26 /**
27  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
28  */

29 public class JdbcComplexTypeSG extends ComplexTypeSGChainImpl {
30   private final JaxMeJdbcSG jdbcSG;
31   private XSType xsType;
32
33   protected JdbcComplexTypeSG(JaxMeJdbcSG pJdbcSG, ComplexTypeSGChain o, XSType pType) {
34     super(o);
35     jdbcSG = pJdbcSG;
36     if (pType == null) {
37       throw new NullPointerException JavaDoc("The XSType argument must not be null.");
38     }
39     xsType = pType;
40   }
41
42   public void init(ComplexTypeSG pTypeSG) throws SAXException JavaDoc {
43     super.init(pTypeSG);
44     TableDetails tableDetails = (TableDetails)
45       XSUtil.getSingleAppinfo(xsType.getAnnotations(), TableDetails.class);
46     if (tableDetails != null) {
47       CustomTableData data = jdbcSG.addTableData(pTypeSG, xsType, tableDetails);
48       pTypeSG.getTypeSG().setProperty(jdbcSG.getKey(), data);
49     }
50   }
51 }
52
Popular Tags