Xerces-C++ 3.2.4

XSAttributeDeclaration.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$
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_XSATTRIBUTEDECLARATION_HPP)
23#define XERCESC_INCLUDE_GUARD_XSATTRIBUTEDECLARATION_HPP
24
25#include <xercesc/framework/psvi/XSObject.hpp>
26
27 XERCES_CPP_NAMESPACE_BEGIN
28
36// forward declarations
37 class XSAnnotation;
38 class XSComplexTypeDefinition;
39 class XSSimpleTypeDefinition;
40 class SchemaAttDef;
41
42 class XMLPARSER_EXPORT XSAttributeDeclaration : public XSObject
43{
44 public:
45
46 // Constructors and Destructor
47 // -----------------------------------------------------------------------
50
62 XSAttributeDeclaration
63 (
64 SchemaAttDef* const attDef
65 , XSSimpleTypeDefinition* const typeDef
66 , XSAnnotation* const annot
67 , XSModel* const xsModel
68 , XSConstants::SCOPE scope
69 , XSComplexTypeDefinition* enclosingCTDefinition
70 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
71 );
72
74
77 ~XSAttributeDeclaration();
79
80 //---------------------
84
89 const XMLCh* getName() const;
90
95 const XMLCh* getNamespace() const;
96
102 XSNamespaceItem* getNamespaceItem();
103
105
109
113 XSSimpleTypeDefinition *getTypeDefinition() const;
114
120 XSConstants::SCOPE getScope() const;
121
126 XSComplexTypeDefinition *getEnclosingCTDefinition();
127
131 XSConstants::VALUE_CONSTRAINT getConstraintType() const;
132
137 const XMLCh *getConstraintValue();
138
142 XSAnnotation *getAnnotation() const;
143
145
146 //----------------------------------
150
151 bool getRequired() const;
153
154 private:
155
156 void setEnclosingCTDefinition(XSComplexTypeDefinition* const toSet);
157 friend class XSObjectFactory;
158
159 // -----------------------------------------------------------------------
160 // Unimplemented constructors and operators
161 // -----------------------------------------------------------------------
162 XSAttributeDeclaration(const XSAttributeDeclaration&);
163 XSAttributeDeclaration & operator=(const XSAttributeDeclaration &);
164
165 protected:
166
167 // -----------------------------------------------------------------------
168 // data members
169 // -----------------------------------------------------------------------
170 SchemaAttDef* fAttDef;
171 XSSimpleTypeDefinition* fTypeDefinition;
172 XSAnnotation* fAnnotation;
173 XSConstants::SCOPE fScope;
174 XSComplexTypeDefinition* fEnclosingCTDefinition;
175};
176
177// ---------------------------------------------------------------------------
178// XSAttributeDeclaration: inline methods
179// ---------------------------------------------------------------------------
180 inline XSSimpleTypeDefinition* XSAttributeDeclaration::getTypeDefinition() const
181{
182 return fTypeDefinition;
183}
184
185 inline XSAnnotation *XSAttributeDeclaration::getAnnotation() const
186{
187 return fAnnotation;
188}
189
190 inline XSConstants::SCOPE XSAttributeDeclaration::getScope() const
191{
192 return fScope;
193}
194
195 inline XSComplexTypeDefinition *XSAttributeDeclaration::getEnclosingCTDefinition()
196{
197 return fEnclosingCTDefinition;
198}
199
200 inline void XSAttributeDeclaration::setEnclosingCTDefinition
201(
202 XSComplexTypeDefinition* const toSet
203)
204{
205 fEnclosingCTDefinition = toSet;
206}
207
208 XERCES_CPP_NAMESPACE_END
209
210#endif
XSObject.hpp
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition: XercesDefs.hpp:163
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:120
MemoryManager
Configurable memory manager.
Definition: MemoryManager.hpp:40
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition: PlatformUtils.hpp:121
XSAnnotation
Definition: XSAnnotation.hpp:42
XSAttributeDeclaration
Definition: XSAttributeDeclaration.hpp:43
XSAttributeDeclaration::~XSAttributeDeclaration
~XSAttributeDeclaration()
XSAttributeDeclaration::fScope
XSConstants::SCOPE fScope
Definition: XSAttributeDeclaration.hpp:173
XSAttributeDeclaration::fTypeDefinition
XSSimpleTypeDefinition * fTypeDefinition
Definition: XSAttributeDeclaration.hpp:171
XSAttributeDeclaration::getScope
XSConstants::SCOPE getScope() const
Optional.
Definition: XSAttributeDeclaration.hpp:190
XSAttributeDeclaration::getAnnotation
XSAnnotation * getAnnotation() const
Optional.
Definition: XSAttributeDeclaration.hpp:185
XSAttributeDeclaration::getNamespaceItem
XSNamespaceItem * getNamespaceItem()
A namespace schema information item corresponding to the target namespace of the component,...
XSAttributeDeclaration::getConstraintValue
const XMLCh * getConstraintValue()
Value constraint: The actual value with respect to the [type definition ].
XSAttributeDeclaration::fAnnotation
XSAnnotation * fAnnotation
Definition: XSAttributeDeclaration.hpp:172
XSAttributeDeclaration::getName
const XMLCh * getName() const
The name of type NCName of this declaration as defined in XML Namespaces.
XSAttributeDeclaration::XSAttributeDeclaration
XSAttributeDeclaration(SchemaAttDef *const attDef, XSSimpleTypeDefinition *const typeDef, XSAnnotation *const annot, XSModel *const xsModel, XSConstants::SCOPE scope, XSComplexTypeDefinition *enclosingCTDefinition, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
The default constructor.
XSAttributeDeclaration::getNamespace
const XMLCh * getNamespace() const
The [target namespace] of this object, or null if it is unspecified.
XSAttributeDeclaration::getConstraintType
XSConstants::VALUE_CONSTRAINT getConstraintType() const
Value constraint: one of VC_NONE, VC_DEFAULT, VC_FIXED.
XSAttributeDeclaration::fEnclosingCTDefinition
XSComplexTypeDefinition * fEnclosingCTDefinition
Definition: XSAttributeDeclaration.hpp:174
XSAttributeDeclaration::fAttDef
SchemaAttDef * fAttDef
Definition: XSAttributeDeclaration.hpp:170
XSAttributeDeclaration::getEnclosingCTDefinition
XSComplexTypeDefinition * getEnclosingCTDefinition()
The complex type definition for locally scoped declarations (see scope).
Definition: XSAttributeDeclaration.hpp:195
XSAttributeDeclaration::getRequired
bool getRequired() const
methods needed by implementation
XSAttributeDeclaration::getTypeDefinition
XSSimpleTypeDefinition * getTypeDefinition() const
[type definition]: A simple type definition
Definition: XSAttributeDeclaration.hpp:180
XSComplexTypeDefinition
Definition: XSComplexTypeDefinition.hpp:46
XSConstants::VALUE_CONSTRAINT
VALUE_CONSTRAINT
Definition: XSConstants.hpp:172
XSConstants::SCOPE
SCOPE
Definition: XSConstants.hpp:152
XSModel
Definition: XSModel.hpp:60
XSNamespaceItem
Definition: XSNamespaceItem.hpp:54
XSObject
Definition: XSObject.hpp:43
XSSimpleTypeDefinition
Definition: XSSimpleTypeDefinition.hpp:44