Xerces-C++ 3.1.2

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

PSVIAttribute.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: PSVIAttribute.hpp 527149 2007-04-10 14:56:39Z amassari $
20 */
21
22 #if !defined(XERCESC_INCLUDE_GUARD_PSVIATTRIBUTE_HPP)
23 #define XERCESC_INCLUDE_GUARD_PSVIATTRIBUTE_HPP
24
25 #include <xercesc/framework/psvi/PSVIItem.hpp>
26 #include <xercesc/framework/psvi/XSSimpleTypeDefinition.hpp>
27 #include <xercesc/validators/datatype/DatatypeValidator.hpp>
28
29 XERCES_CPP_NAMESPACE_BEGIN
30
38 // forward declarations
39 class XSAttributeDeclaration;
40
41 class XMLPARSER_EXPORT PSVIAttribute : public PSVIItem
42 {
43 public:
44
45 // Constructors and Destructor
46 // -----------------------------------------------------------------------
49
55 PSVIAttribute( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
56
58
61 ~PSVIAttribute();
63
64 //---------------------
68
75 XSAttributeDeclaration *getAttributeDeclaration();
76
82 XSTypeDefinition *getTypeDefinition();
83
93 XSSimpleTypeDefinition *getMemberTypeDefinition();
94
96
97 //----------------------------------
101
106 void reset(
107 const XMLCh * const valContext
108 , PSVIItem::VALIDITY_STATE state
109 , PSVIItem::ASSESSMENT_TYPE assessmentType
110 , XSSimpleTypeDefinition * validatingType
111 , XSSimpleTypeDefinition * memberType
112 , const XMLCh * const defaultValue
113 , const bool isSpecified
114 , XSAttributeDeclaration * attrDecl
115 , DatatypeValidator * dv
116 );
117
123 void setValue(const XMLCh * const normalizedValue);
124
129 void updateValidity(VALIDITY_STATE newValue);
130
132
133 private:
134
135 // -----------------------------------------------------------------------
136 // Unimplemented constructors and operators
137 // -----------------------------------------------------------------------
138 PSVIAttribute(const PSVIAttribute&);
139 PSVIAttribute & operator=(const PSVIAttribute &);
140
141
142 // -----------------------------------------------------------------------
143 // data members
144 // -----------------------------------------------------------------------
145 // fAttributeDecl
146 // attribute declaration component that validated this attribute
147 // fDV
148 // implementation-specific datatype validator used to validate this attribute
149 XSAttributeDeclaration * fAttributeDecl;
150 DatatypeValidator * fDV;
151 };
152 inline PSVIAttribute::~PSVIAttribute()
153 {
154 fMemoryManager->deallocate((void *)fCanonicalValue);
155 }
156
157 inline XSAttributeDeclaration *PSVIAttribute::getAttributeDeclaration()
158 {
159 return fAttributeDecl;
160 }
161
162 inline XSTypeDefinition* PSVIAttribute::getTypeDefinition()
163 {
164 return fType;
165 }
166
167 inline XSSimpleTypeDefinition* PSVIAttribute::getMemberTypeDefinition()
168 {
169 return fMemberType;
170 }
171
172 inline void PSVIAttribute::updateValidity(VALIDITY_STATE newValue)
173 {
174 fValidityState = newValue;
175 }
176
177 XERCES_CPP_NAMESPACE_END
178
179 #endif
MemoryManager::deallocate
virtual void deallocate(void *p)=0
This method deallocates memory.
PSVIAttribute::updateValidity
void updateValidity(VALIDITY_STATE newValue)
set VALIDITY_STATE to specified value; intended to be called by implementation.
Definition: PSVIAttribute.hpp:172
PSVIItem::fMemoryManager
MemoryManager *const fMemoryManager
Definition: PSVIItem.hpp:258
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition: PlatformUtils.hpp:121
PSVIItem::fValidityState
VALIDITY_STATE fValidityState
Definition: PSVIItem.hpp:263
PSVIItem::fMemberType
XSSimpleTypeDefinition * fMemberType
Definition: PSVIItem.hpp:267
PSVIItem::fType
XSTypeDefinition * fType
Definition: PSVIItem.hpp:266
PSVIAttribute::getTypeDefinition
XSTypeDefinition * getTypeDefinition()
An item isomorphic to the type definition used to validate this element.
Definition: PSVIAttribute.hpp:162
PSVIAttribute::~PSVIAttribute
~PSVIAttribute()
Definition: PSVIAttribute.hpp:152
PSVIItem::fCanonicalValue
XMLCh * fCanonicalValue
Definition: PSVIItem.hpp:262
PSVIItem::getTypeDefinition
virtual XSTypeDefinition * getTypeDefinition()=0
An item isomorphic to the type definition used to validate this element.
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition: XercesDefs.hpp:163
PSVIAttribute::getMemberTypeDefinition
XSSimpleTypeDefinition * getMemberTypeDefinition()
If and only if that type definition is a simple type definition with {variety} union, or a complex type definition whose {content type} is a simple thype definition with {variety} union, then an item isomorphic to that member of the union's {member type definitions} which actually validated the element item's normalized value.
Definition: PSVIAttribute.hpp:167
PSVIItem::VALIDITY_STATE
VALIDITY_STATE
Definition: PSVIItem.hpp:45
MemoryManager
Configurable memory manager.
Definition: MemoryManager.hpp:39
XSSimpleTypeDefinition
Definition: XSSimpleTypeDefinition.hpp:43
PSVIItem
Definition: PSVIItem.hpp:41
PSVIAttribute::getAttributeDeclaration
XSAttributeDeclaration * getAttributeDeclaration()
An item isomorphic to the attribute declaration used to validate this attribute.
Definition: PSVIAttribute.hpp:157
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
XMLCh
wchar_t XMLCh
Definition: Xerces_autoconf_config.borland.hpp:92
XSSimpleTypeDefinition.hpp
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
PSVIItem::reset
void reset(const XMLCh *const validationContext, const XMLCh *const normalizedValue, const VALIDITY_STATE validityState, const ASSESSMENT_TYPE assessmentType)
reset the object
PSVIItem.hpp
PSVIItem::getMemberTypeDefinition
virtual XSSimpleTypeDefinition * getMemberTypeDefinition()=0
If and only if that type definition is a simple type definition with {variety} union, or a complex type definition whose {content type} is a simple thype definition with {variety} union, then an item isomorphic to that member of the union's {member type definitions} which actually validated the element item's normalized value.
PSVIItem::ASSESSMENT_TYPE
ASSESSMENT_TYPE
Definition: PSVIItem.hpp:65
XSAttributeDeclaration
Definition: XSAttributeDeclaration.hpp:42
XSTypeDefinition
This class represents a complexType or simpleType definition.
Definition: XSTypeDefinition.hpp:39
PSVIAttribute
Definition: PSVIAttribute.hpp:41