KickJava   Java API By Example, From Geeks To Geeks.

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


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.XSAtomicType;
20 import org.apache.ws.jaxme.xs.XSEnumeration;
21 import org.apache.ws.jaxme.xs.XSListType;
22 import org.apache.ws.jaxme.xs.XSSimpleType;
23 import org.apache.ws.jaxme.xs.XSType;
24 import org.apache.ws.jaxme.xs.XSUnionType;
25 import org.apache.ws.jaxme.xs.impl.XSUtil;
26 import org.apache.ws.jaxme.xs.jaxb.JAXBJavaType;
27 import org.apache.ws.jaxme.xs.jaxb.JAXBSimpleType;
28 import org.apache.ws.jaxme.xs.jaxb.JAXBTypesafeEnumClass;
29 import org.xml.sax.SAXException JavaDoc;
30
31
32 /**
33  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
34  */

35 public class JAXBSimpleTypeImpl implements JAXBSimpleType {
36   private final XSSimpleType baseType;
37   private final JAXBJavaType jaxbJavaType;
38   private final JAXBTypesafeEnumClass jaxbTypesafeEnumClass;
39
40   /** <p>Creates a new instance of JAXBSimpleTypeImpl.</p>
41    */

42   protected JAXBSimpleTypeImpl(XSType pMyType, XSSimpleType pBaseType) throws SAXException JavaDoc {
43     jaxbJavaType = (JAXBJavaType) XSUtil.getSingleAppinfo(pMyType.getAnnotations(), JAXBJavaType.class);
44     jaxbTypesafeEnumClass = (JAXBTypesafeEnumClass) XSUtil.getSingleAppinfo(pMyType.getAnnotations(), JAXBTypesafeEnumClass.class);
45     baseType = pBaseType;
46   }
47
48   public JAXBJavaType getJAXBJavaType() { return jaxbJavaType; }
49   public JAXBTypesafeEnumClass getJAXBTypesafeEnumClass() { return jaxbTypesafeEnumClass; }
50   public boolean isAtomic() { return baseType.isAtomic(); }
51   public XSAtomicType getAtomicType() { return baseType.getAtomicType(); }
52   public boolean isList() { return baseType.isList(); }
53   public XSListType getListType() { return baseType.getListType(); }
54   public boolean isUnion() { return baseType.isUnion(); }
55   public XSUnionType getUnionType() { return baseType.getUnionType(); }
56   public String JavaDoc[][] getPattern() { return baseType.getPattern(); }
57   public XSEnumeration[] getEnumerations() { return baseType.getEnumerations(); }
58   public boolean isRestriction() { return baseType.isRestriction(); }
59   public XSType getRestrictedType() { return baseType.getRestrictedType(); }
60 }
61
Popular Tags