KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > xs > xml > impl > XsTSimpleExtensionTypeImpl


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.xml.impl;
18
19 import org.apache.ws.jaxme.xs.parser.impl.LocSAXException;
20 import org.apache.ws.jaxme.xs.xml.*;
21 import org.xml.sax.SAXException JavaDoc;
22
23
24 /** <p>Implementation of the <code>xs:simpleExtensionType</code>, as
25  * specified by:
26  * <pre>
27  * <xs:complexType name="simpleExtensionType">
28  * <xs:complexContent>
29  * <xs:restriction base="xs:extensionType">
30  * <xs:sequence>
31  * <xs:annotation>
32  * <xs:documentation>
33  * No typeDefParticle group reference
34  * </xs:documentation>
35  * </xs:annotation>
36  * <xs:element ref="xs:annotation" minOccurs="0"/>
37  * <xs:group ref="xs:attrDecls"/>
38  * </xs:sequence>
39  * </xs:restriction>
40  * </xs:complexContent>
41  * </xs:complexType>
42  * </pre></p>
43  *
44  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
45  */

46 public class XsTSimpleExtensionTypeImpl extends XsTAnnotatedImpl implements XsTSimpleExtensionType {
47   private XsQName base;
48   private final XsGAttrDecls attrDecls;
49
50   protected XsTSimpleExtensionTypeImpl(XsObject pParent) {
51     super(pParent);
52     attrDecls = getObjectFactory().newXsGAttrDecls(this);
53   }
54
55   public void setBase(XsQName pBase) {
56     base = pBase;
57   }
58
59   public void setBase(String JavaDoc pBase) throws SAXException {
60     setBase(asXsQName(pBase));
61   }
62
63   public XsQName getBase() {
64     return base;
65   }
66
67   public void validate() throws SAXException {
68     super.validate();
69     if (getBase() == null) {
70       throw new LocSAXException("The 'base' attribute must be set.", getLocator());
71     }
72   }
73
74   public XsTAttribute createAttribute() {
75     return attrDecls.createAttribute();
76   }
77
78   public XsTAttribute[] getAttributes() {
79     return attrDecls.getAttributes();
80   }
81
82   public XsTAttributeGroupRef createAttributeGroup() {
83     return attrDecls.createAttributeGroup();
84   }
85
86   public XsTAttributeGroupRef[] getAttributeGroups() {
87     return attrDecls.getAttributeGroups();
88   }
89
90   public XsTWildcard createAnyAttribute() {
91     return attrDecls.createAnyAttribute();
92   }
93
94   public XsTWildcard getAnyAttribute() {
95     return attrDecls.getAnyAttribute();
96   }
97
98   public Object JavaDoc[] getAllAttributes() {
99     return attrDecls.getAllAttributes();
100   }
101 }
102
Popular Tags