Xerces-C++  3.1.3
XSComplexTypeDefinition.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 /*
19  * $Id: XSComplexTypeDefinition.hpp 932887 2010-04-11 13:04:59Z borisk $
20  */
21 
22 #if !defined(XERCESC_INCLUDE_GUARD_XSCOMPLEXTYPEDEFINITION_HPP)
23 #define XERCESC_INCLUDE_GUARD_XSCOMPLEXTYPEDEFINITION_HPP
24 
26 
28 
37 // forward declarations
38 class XSAnnotation;
39 class XSAttributeUse;
41 class XSParticle;
42 class XSWildcard;
43 class ComplexTypeInfo;
44 
46 {
47 public:
48 
49  // Content Model Types
50  enum CONTENT_TYPE {
56  CONTENTTYPE_EMPTY = 0,
61  CONTENTTYPE_SIMPLE = 1,
67  CONTENTTYPE_ELEMENT = 2,
71  CONTENTTYPE_MIXED = 3
72  };
73 
74  // Constructors and Destructor
75  // -----------------------------------------------------------------------
78 
93  (
94  ComplexTypeInfo* const complexTypeInfo
95  , XSWildcard* const xsWildcard
96  , XSSimpleTypeDefinition* const xsSimpleType
97  , XSAttributeUseList* const xsAttList
98  , XSTypeDefinition* const xsBaseType
99  , XSParticle* const xsParticle
100  , XSAnnotation* const headAnnot
101  , XSModel* const xsModel
103  );
104 
106 
111 
112  //---------------------
116 
122  XSConstants::DERIVATION_TYPE getDerivationMethod() const;
123 
129  bool getAbstract() const;
130 
134  XSAttributeUseList *getAttributeUses();
135 
139  XSWildcard *getAttributeWildcard() const;
140 
147  CONTENT_TYPE getContentType() const;
148 
153  XSSimpleTypeDefinition *getSimpleType() const;
154 
159  XSParticle *getParticle() const;
160 
168  bool isProhibitedSubstitution(XSConstants::DERIVATION_TYPE toTest);
169 
175  short getProhibitedSubstitutions() const;
176 
180  XSAnnotationList *getAnnotations();
181 
186  const XMLCh* getName() const;
187 
192  const XMLCh* getNamespace();
193 
200 
205  bool getAnonymous() const;
206 
212 
220  bool derivedFromType(const XSTypeDefinition* const ancestorType);
221 
223 
224  //----------------------------------
228 
229 
231 
232 private:
233 
237  void setBaseType(XSTypeDefinition* const xsBaseType);
238  friend class XSObjectFactory;
239 
240  // -----------------------------------------------------------------------
241  // Unimplemented constructors and operators
242  // -----------------------------------------------------------------------
245 
246 protected:
247 
248  // -----------------------------------------------------------------------
249  // data members
250  // -----------------------------------------------------------------------
251  ComplexTypeInfo* fComplexTypeInfo;
258 };
259 
260 
262 {
263  return fXSAttributeUseList;
264 }
265 
267 {
268  return fXSWildcard;
269 }
270 
272 {
274 }
275 
277 {
279 }
280 
282 {
283  return fParticle;
284 }
285 
286 inline void
287 XSComplexTypeDefinition::setBaseType(XSTypeDefinition* const xsBaseType)
288 {
289  fBaseType = xsBaseType;
290 }
291 
293 
294 #endif