KickJava   Java API By Example, From Geeks To Geeks.

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


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 a top level <code>xs:complexType</code>,
25  * following the specification below:
26  * <pre>
27  * &lt;xs:complexType name="topLevelComplexType"&gt;
28  * &lt;xs:complexContent&gt;
29  * &lt;xs:restriction base="xs:complexType"&gt;
30  * &lt;xs:sequence&gt;
31  * &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
32  * &lt;xs:group ref="xs:complexTypeModel"/&gt;
33  * &lt;/xs:sequence&gt;
34  * &lt;xs:attribute name="name" type="xs:NCName" use="required"/&gt;
35  * &lt;/xs:restriction&gt;
36  * &lt;/xs:complexContent&gt;
37  * &lt;/xs:complexType&gt;
38  * </pre></p>
39  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
40  */

41 public class XsTTopLevelComplexTypeImpl extends XsTComplexTypeImpl implements XsTTopLevelComplexType {
42   private XsNCName name;
43   private boolean isMixed, isAbstract;
44   private XsDerivationSet finalSet;
45   private XsDerivationSet blockSet;
46
47   protected XsTTopLevelComplexTypeImpl(XsObject pParent) {
48     super(pParent);
49   }
50
51   public void setName(XsNCName pName) {
52     name = pName;
53   }
54
55   public XsNCName getName() {
56     return name;
57   }
58
59   public void setMixed(boolean pMixed) {
60     isMixed = pMixed;
61   }
62
63   public boolean isMixed() {
64     return isMixed;
65   }
66
67   public void setAbstract(boolean pAbstract) {
68     isAbstract = pAbstract;
69   }
70
71   public boolean isAbstract() {
72     return isAbstract;
73   }
74
75   public void setFinal(XsDerivationSet pFinal) {
76     finalSet = pFinal;
77   }
78
79   public XsDerivationSet getFinal() {
80     return finalSet;
81   }
82
83   public void setBlock(XsDerivationSet pBlock) {
84     blockSet = pBlock;
85   }
86
87   public XsDerivationSet getBlock() {
88     return blockSet;
89   }
90
91   public void validate() throws SAXException {
92     super.validate();
93     if (name == null) {
94       throw new LocSAXException("Missing attribute: 'name'", getLocator());
95     }
96   }
97 }
98
Popular Tags