KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > xs > jaxb > impl > JAXBTypeImpl


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.xs.jaxb.impl;
18
19 import org.apache.ws.jaxme.xs.XSObject;
20 import org.apache.ws.jaxme.xs.impl.XSTypeImpl;
21 import org.apache.ws.jaxme.xs.impl.XSUtil;
22 import org.apache.ws.jaxme.xs.jaxb.JAXBClass;
23 import org.apache.ws.jaxme.xs.jaxb.JAXBJavaType;
24 import org.apache.ws.jaxme.xs.jaxb.JAXBSchemaBindings;
25 import org.apache.ws.jaxme.xs.jaxb.JAXBType;
26 import org.apache.ws.jaxme.xs.xml.XsETopLevelSimpleType;
27 import org.apache.ws.jaxme.xs.xml.XsTComplexType;
28 import org.apache.ws.jaxme.xs.xml.XsTLocalComplexType;
29 import org.apache.ws.jaxme.xs.xml.XsTLocalSimpleType;
30 import org.apache.ws.jaxme.xs.xml.XsTSimpleRestrictionType;
31 import org.xml.sax.SAXException JavaDoc;
32
33
34 /**
35  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
36  */

37 public class JAXBTypeImpl extends XSTypeImpl implements JAXBType {
38   private JAXBClass jaxbClass;
39   private JAXBJavaType jaxbJavaType;
40
41   /** <p>Creates a new instance of JAXBTypeImpl.</p>
42    */

43   protected JAXBTypeImpl(XSObject pParent, XsETopLevelSimpleType pSimpleType) throws SAXException JavaDoc {
44     super(pParent, pSimpleType);
45   }
46
47   /** <p>Creates a new instance of JAXBTypeImpl.</p>
48    */

49   protected JAXBTypeImpl(XSObject pParent, XsTLocalSimpleType pSimpleType) throws SAXException JavaDoc {
50     super(pParent, pSimpleType);
51   }
52
53   /** <p>Creates a new instance of JAXBTypeImpl.</p>
54    */

55   protected JAXBTypeImpl(XSObject pParent, XsTSimpleRestrictionType pSimpleType) throws SAXException JavaDoc {
56     super(pParent, pSimpleType);
57   }
58
59   /** <p>Creates a new instance of JAXBTypeImpl.</p>
60    */

61   protected JAXBTypeImpl(XSObject pParent, XsTComplexType pComplexType) throws SAXException JavaDoc {
62     super(pParent, pComplexType);
63   }
64
65   /** <p>Creates a new instance of JAXBTypeImpl.</p>
66    */

67   protected JAXBTypeImpl(XSObject pParent, XsTLocalComplexType pComplexType) throws SAXException JavaDoc {
68     super(pParent, pComplexType);
69   }
70
71   public JAXBSchemaBindings getJAXBSchemaBindings() {
72     return ((JAXBXsSchemaImpl) getXsObject().getXsESchema()).getJAXBSchemaBindings();
73   }
74
75   public JAXBClass getJAXBClass() {
76     return jaxbClass;
77   }
78
79   public JAXBJavaType getJAXBJavaType() {
80     return jaxbJavaType;
81   }
82
83   public void validate() throws SAXException JavaDoc {
84     if (isValidated()) {
85       return;
86     }
87     super.validate();
88     jaxbClass = (JAXBClass) XSUtil.getSingleAppinfo(getAnnotations(), JAXBClass.class);
89     jaxbJavaType = (JAXBJavaType) XSUtil.getSingleAppinfo(getAnnotations(), JAXBJavaType.class);
90   }
91 }
92
Popular Tags