KickJava   Java API By Example, From Geeks To Geeks.

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


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.impl.XSSchemaImpl;
20 import org.apache.ws.jaxme.xs.impl.XSUtil;
21 import org.apache.ws.jaxme.xs.jaxb.*;
22 import org.apache.ws.jaxme.xs.jaxb.JAXBGlobalBindings;
23 import org.apache.ws.jaxme.xs.jaxb.JAXBSchema;
24 import org.apache.ws.jaxme.xs.jaxb.JAXBXsObjectFactory;
25 import org.apache.ws.jaxme.xs.parser.XSContext;
26 import org.apache.ws.jaxme.xs.xml.XsESchema;
27 import org.xml.sax.SAXException JavaDoc;
28
29
30 /**
31  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
32  */

33 public class JAXBSchemaImpl extends XSSchemaImpl implements JAXBSchema {
34   private JAXBGlobalBindings globalBindings;
35
36   /** <p>Creates a new instance of JAXBSchemaImpl.</p>
37    */

38   protected JAXBSchemaImpl(XSContext pContext, XsESchema pSchema) throws SAXException JavaDoc {
39     super(pContext, pSchema);
40   }
41
42   public void validate() throws SAXException JavaDoc {
43     if (isValidated()) {
44       return;
45     }
46     super.validate();
47     JAXBGlobalBindings gBindings = (JAXBGlobalBindings) XSUtil.getSingleAppinfo(getAnnotations(), JAXBGlobalBindings.class);
48     globalBindings = gBindings == null ?
49       ((JAXBXsObjectFactory) getXsESchema().getObjectFactory()).newJAXBGlobalBindings(getXsESchema()) : gBindings;
50   }
51
52   public JAXBGlobalBindings getJAXBGlobalBindings() {
53     return globalBindings;
54   }
55
56   public String JavaDoc getJaxbVersion() {
57     return ((JAXBXsSchema) getXsESchema()).getJaxbVersion();
58   }
59
60   public String JavaDoc[] getJaxbExtensionBindingPrefixes() {
61     return ((JAXBXsSchema) getXsESchema()).getJaxbExtensionBindingPrefixes();
62   }
63 }
64
Popular Tags