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: XSConstants.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
20 | */ |
---|
21 | |
---|
22 | #if !defined(XSCONSTANTS_HPP) |
---|
23 | #define XSCONSTANTS_HPP |
---|
24 | |
---|
25 | #include <xercesc/util/RefVectorOf.hpp> |
---|
26 | #include <xercesc/util/RefArrayVectorOf.hpp> |
---|
27 | |
---|
28 | XERCES_CPP_NAMESPACE_BEGIN |
---|
29 | |
---|
30 | /** |
---|
31 | * This contains constants needed in the schema component model. |
---|
32 | */ |
---|
33 | |
---|
34 | // forward definitions for typedefs |
---|
35 | class XSAnnotation; |
---|
36 | class XSAttributeUse; |
---|
37 | class XSFacet; |
---|
38 | class XSMultiValueFacet; |
---|
39 | class XSNamespaceItem; |
---|
40 | class XSParticle; |
---|
41 | class XSSimpleTypeDefinition; |
---|
42 | |
---|
43 | // these typedefs are intended to help hide dependence on utility |
---|
44 | // classes, as well as to define more intuitive names for commonly |
---|
45 | // used concepts. |
---|
46 | |
---|
47 | typedef RefVectorOf <XSAnnotation> XSAnnotationList; |
---|
48 | typedef RefVectorOf <XSAttributeUse> XSAttributeUseList; |
---|
49 | typedef RefVectorOf <XSFacet> XSFacetList; |
---|
50 | typedef RefVectorOf <XSMultiValueFacet> XSMultiValueFacetList; |
---|
51 | typedef RefVectorOf <XSNamespaceItem> XSNamespaceItemList; |
---|
52 | typedef RefVectorOf <XSParticle> XSParticleList; |
---|
53 | typedef RefVectorOf <XSSimpleTypeDefinition> XSSimpleTypeDefinitionList; |
---|
54 | typedef RefArrayVectorOf <XMLCh> StringList; |
---|
55 | |
---|
56 | class XMLPARSER_EXPORT XSConstants |
---|
57 | { |
---|
58 | public: |
---|
59 | |
---|
60 | // XML Schema Components |
---|
61 | enum COMPONENT_TYPE { |
---|
62 | /** |
---|
63 | * The object describes an attribute declaration. |
---|
64 | */ |
---|
65 | ATTRIBUTE_DECLARATION = 1, |
---|
66 | /** |
---|
67 | * The object describes an element declaration. |
---|
68 | */ |
---|
69 | ELEMENT_DECLARATION = 2, |
---|
70 | /** |
---|
71 | * The object describes a complex type or simple type definition. |
---|
72 | */ |
---|
73 | TYPE_DEFINITION = 3, |
---|
74 | /** |
---|
75 | * The object describes an attribute use definition. |
---|
76 | */ |
---|
77 | ATTRIBUTE_USE = 4, |
---|
78 | /** |
---|
79 | * The object describes an attribute group definition. |
---|
80 | */ |
---|
81 | ATTRIBUTE_GROUP_DEFINITION= 5, |
---|
82 | /** |
---|
83 | * The object describes a model group definition. |
---|
84 | */ |
---|
85 | MODEL_GROUP_DEFINITION = 6, |
---|
86 | /** |
---|
87 | * A model group. |
---|
88 | */ |
---|
89 | MODEL_GROUP = 7, |
---|
90 | /** |
---|
91 | * The object describes a particle. |
---|
92 | */ |
---|
93 | PARTICLE = 8, |
---|
94 | /** |
---|
95 | * The object describes a wildcard. |
---|
96 | */ |
---|
97 | WILDCARD = 9, |
---|
98 | /** |
---|
99 | * The object describes an identity constraint definition. |
---|
100 | */ |
---|
101 | IDENTITY_CONSTRAINT = 10, |
---|
102 | /** |
---|
103 | * The object describes a notation declaration. |
---|
104 | */ |
---|
105 | NOTATION_DECLARATION = 11, |
---|
106 | /** |
---|
107 | * The object describes an annotation. |
---|
108 | */ |
---|
109 | ANNOTATION = 12, |
---|
110 | /** |
---|
111 | * The object describes a constraining facet. |
---|
112 | */ |
---|
113 | FACET = 13, |
---|
114 | |
---|
115 | /** |
---|
116 | * The object describes enumeration/pattern facets. |
---|
117 | */ |
---|
118 | MULTIVALUE_FACET = 14 |
---|
119 | }; |
---|
120 | |
---|
121 | // Derivation constants |
---|
122 | enum DERIVATION_TYPE { |
---|
123 | /** |
---|
124 | * No constraint is available. |
---|
125 | */ |
---|
126 | DERIVATION_NONE = 0, |
---|
127 | /** |
---|
128 | * <code>XSTypeDefinition</code> final set or |
---|
129 | * <code>XSElementDeclaration</code> disallowed substitution group. |
---|
130 | */ |
---|
131 | DERIVATION_EXTENSION = 1, |
---|
132 | /** |
---|
133 | * <code>XSTypeDefinition</code> final set or |
---|
134 | * <code>XSElementDeclaration</code> disallowed substitution group. |
---|
135 | */ |
---|
136 | DERIVATION_RESTRICTION = 2, |
---|
137 | /** |
---|
138 | * <code>XSTypeDefinition</code> final set. |
---|
139 | */ |
---|
140 | DERIVATION_SUBSTITUTION = 4, |
---|
141 | /** |
---|
142 | * <code>XSTypeDefinition</code> final set. |
---|
143 | */ |
---|
144 | DERIVATION_UNION = 8, |
---|
145 | /** |
---|
146 | * <code>XSTypeDefinition</code> final set. |
---|
147 | */ |
---|
148 | DERIVATION_LIST = 16 |
---|
149 | }; |
---|
150 | |
---|
151 | // Scope |
---|
152 | enum SCOPE { |
---|
153 | /** |
---|
154 | * The scope of a declaration within named model groups or attribute |
---|
155 | * groups is <code>absent</code>. The scope of such declaration is |
---|
156 | * determined when it is used in the construction of complex type |
---|
157 | * definitions. |
---|
158 | */ |
---|
159 | SCOPE_ABSENT = 0, |
---|
160 | /** |
---|
161 | * A scope of <code>global</code> identifies top-level declarations. |
---|
162 | */ |
---|
163 | SCOPE_GLOBAL = 1, |
---|
164 | /** |
---|
165 | * <code>Locally scoped</code> declarations are available for use only |
---|
166 | * within the complex type. |
---|
167 | */ |
---|
168 | SCOPE_LOCAL = 2 |
---|
169 | }; |
---|
170 | |
---|
171 | // Value Constraint |
---|
172 | enum VALUE_CONSTRAINT { |
---|
173 | /** |
---|
174 | * Indicates that the component does not have any value constraint. |
---|
175 | */ |
---|
176 | VALUE_CONSTRAINT_NONE = 0, |
---|
177 | /** |
---|
178 | * Indicates that there is a default value constraint. |
---|
179 | */ |
---|
180 | VALUE_CONSTRAINT_DEFAULT = 1, |
---|
181 | /** |
---|
182 | * Indicates that there is a fixed value constraint for this attribute. |
---|
183 | */ |
---|
184 | VALUE_CONSTRAINT_FIXED = 2 |
---|
185 | }; |
---|
186 | |
---|
187 | private: |
---|
188 | // ----------------------------------------------------------------------- |
---|
189 | // Unimplemented constructors and operators |
---|
190 | // ----------------------------------------------------------------------- |
---|
191 | XSConstants(); |
---|
192 | }; |
---|
193 | |
---|
194 | XERCES_CPP_NAMESPACE_END |
---|
195 | |
---|
196 | #endif |
---|