KickJava   Java API By Example, From Geeks To Geeks.

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


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.xml.*;
20 import org.xml.sax.SAXException JavaDoc;
21
22
23 /** <p>Implementation of <code>xs:restriction</code>, following
24  * this specification:
25  * <pre>
26  * &lt;xs:element name="restriction" id="restriction"&gt;
27  * &lt;xs:complexType&gt;
28  * &lt;xs:annotation&gt;
29  * &lt;xs:documentation
30  * source="http://www.w3.org/TR/xmlschema-2/#element-restriction"&gt;
31  * base attribute and simpleType child are mutually
32  * exclusive, but one or other is required
33  * &lt;/xs:documentation&gt;
34  * &lt;/xs:annotation&gt;
35  * &lt;xs:complexContent&gt;
36  * &lt;xs:extension base="xs:annotated"&gt;
37  * &lt;xs:group ref="xs:simpleRestrictionModel"/&gt;
38  * &lt;xs:attribute name="base" type="xs:QName" use="optional"/&gt;
39  * &lt;/xs:extension&gt;
40  * &lt;/xs:complexContent&gt;
41  * &lt;/xs:complexType&gt;
42  * &lt;/xs:element&gt;
43  *
44  * &lt;xs:group name="simpleRestrictionModel"&gt;
45  * &lt;xs:sequence&gt;
46  * &lt;xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/&gt;
47  * &lt;xs:group ref="xs:facets" minOccurs="0" maxOccurs="unbounded"/&gt;
48  * &lt;/xs:sequence&gt;
49  * &lt;/xs:group&gt;
50  *
51  * &lt;xs:group name="facets"&gt;
52  * &lt;xs:annotation&gt;
53  * &lt;xs:documentation&gt;
54  * We should use a substitution group for facets, but
55  * that's ruled out because it would allow users to
56  * add their own, which we're not ready for yet.
57  * &lt;/xs:documentation&gt;
58  * &lt;/xs:annotation&gt;
59  * &lt;xs:choice&gt;
60  * &lt;xs:element ref="xs:minExclusive"/&gt;
61  * &lt;xs:element ref="xs:minInclusive"/&gt;
62  * &lt;xs:element ref="xs:maxExclusive"/&gt;
63  * &lt;xs:element ref="xs:maxInclusive"/&gt;
64  * &lt;xs:element ref="xs:totalDigits"/&gt;
65  * &lt;xs:element ref="xs:fractionDigits"/&gt;
66  * &lt;xs:element ref="xs:length"/&gt;
67  * &lt;xs:element ref="xs:minLength"/&gt;
68  * &lt;xs:element ref="xs:maxLength"/&gt;
69  * &lt;xs:element ref="xs:enumeration"/&gt;
70  * &lt;xs:element ref="xs:whiteSpace"/&gt;
71  * &lt;xs:element ref="xs:pattern"/&gt;
72  * &lt;/xs:choice&gt;
73  * &lt;/xs:group&gt;
74  * </pre></p>
75  *
76  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
77  */

78 public class XsERestrictionImpl extends XsTAnnotatedImpl implements XsERestriction {
79   private XsQName base;
80
81   protected XsERestrictionImpl(XsObject pParent) {
82     super(pParent);
83   }
84
85   private XsGSimpleRestrictionModel impl = getObjectFactory().newXsGSimpleRestrictionModel(this);
86
87   public void setBase(XsQName pBase) {
88     if (getSimpleType() != null) {
89       throw new IllegalStateException JavaDoc("The 'base' attribute and the inner 'simpleType' child element are mutually exclusive,");
90     }
91     base = pBase;
92   }
93
94   public void setBase(String JavaDoc pBase) throws SAXException JavaDoc {
95     setBase(asXsQName(pBase));
96   }
97
98   public XsQName getBase() {
99     return base;
100   }
101
102   public XsTLocalSimpleType createSimpleType() throws SAXException JavaDoc {
103     if (base != null) {
104       throw new IllegalStateException JavaDoc("The 'base' attribute and the inner 'simpleType' child element are mutually exclusive,");
105     }
106     return impl.createSimpleType();
107   }
108
109   public XsTLocalSimpleType getSimpleType() {
110     return impl.getSimpleType();
111   }
112
113   public XsEMinExclusive createMinExclusive() throws SAXException JavaDoc {
114     return impl.createMinExclusive();
115   }
116
117   public XsEMinExclusive getMinExclusive() {
118     return impl.getMinExclusive();
119   }
120
121   public XsEMinInclusive createMinInclusive() throws SAXException JavaDoc {
122     return impl.createMinInclusive();
123   }
124
125   public XsEMinInclusive getMinInclusive() {
126     return impl.getMinInclusive();
127   }
128
129   public XsEMaxExclusive createMaxExclusive() throws SAXException JavaDoc {
130     return impl.createMaxExclusive();
131   }
132
133   public XsEMaxExclusive getMaxExclusive() {
134     return impl.getMaxExclusive();
135   }
136
137   public XsEMaxInclusive createMaxInclusive() throws SAXException JavaDoc {
138     return impl.createMaxInclusive();
139   }
140
141   public XsEMaxInclusive getMaxInclusive() {
142     return impl.getMaxInclusive();
143   }
144
145   public XsETotalDigits createTotalDigits() throws SAXException JavaDoc {
146     return impl.createTotalDigits();
147   }
148
149   public XsETotalDigits getTotalDigits() {
150     return impl.getTotalDigits();
151   }
152
153   public XsEFractionDigits createFractionDigits() throws SAXException JavaDoc {
154     return impl.createFractionDigits();
155   }
156
157   public XsEFractionDigits getFractionDigits() {
158     return impl.getFractionDigits();
159   }
160
161   public XsELength createLength() throws SAXException JavaDoc {
162     return impl.createLength();
163   }
164
165   public XsELength getLength() {
166     return impl.getLength();
167   }
168
169   public XsEMinLength createMinLength() throws SAXException JavaDoc {
170     return impl.createMinLength();
171   }
172
173   public XsEMinLength getMinLength() {
174     return impl.getMinLength();
175   }
176
177   public XsEMaxLength createMaxLength() throws SAXException JavaDoc {
178     return impl.createMaxLength();
179   }
180
181   public XsEMaxLength getMaxLength() {
182     return impl.getMaxLength();
183   }
184
185   public XsEWhiteSpace createWhiteSpace() throws SAXException JavaDoc {
186     return impl.createWhiteSpace();
187   }
188
189   public XsEWhiteSpace getWhiteSpace() {
190     return impl.getWhiteSpace();
191   }
192
193   public XsEPattern createPattern() throws SAXException JavaDoc {
194     return impl.createPattern();
195   }
196
197   public XsEPattern[] getPatterns() {
198     return impl.getPatterns();
199   }
200
201   public XsEEnumeration createEnumeration() throws SAXException JavaDoc {
202     return impl.createEnumeration();
203   }
204
205   public XsEEnumeration[] getEnumerations() {
206     return impl.getEnumerations();
207   }
208
209   public boolean hasFacets() {
210     return impl.hasFacets();
211   }
212
213   public XsTFacetBase[] getFacets() {
214     return impl.getFacets();
215   }
216 }
217
Popular Tags