PSVIAttribute.hpp
Go to the documentation of this file.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id$
*/
#if !defined(XERCESC_INCLUDE_GUARD_PSVIATTRIBUTE_HPP)
#define XERCESC_INCLUDE_GUARD_PSVIATTRIBUTE_HPP
#include <xercesc/framework/psvi/PSVIItem.hpp>
#include <xercesc/framework/psvi/XSSimpleTypeDefinition.hpp>
#include <xercesc/validators/datatype/DatatypeValidator.hpp>
XERCES_CPP_NAMESPACE_BEGIN
// forward declarations
class XSAttributeDeclaration;
class XMLPARSER_EXPORT PSVIAttribute : public PSVIItem
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
PSVIAttribute( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
~PSVIAttribute();
//---------------------
XSAttributeDeclaration *getAttributeDeclaration();
XSTypeDefinition *getTypeDefinition();
XSSimpleTypeDefinition *getMemberTypeDefinition();
//----------------------------------
void reset(
const XMLCh * const valContext
, PSVIItem::VALIDITY_STATE state
, PSVIItem::ASSESSMENT_TYPE assessmentType
, XSSimpleTypeDefinition * validatingType
, XSSimpleTypeDefinition * memberType
, const XMLCh * const defaultValue
, const bool isSpecified
, XSAttributeDeclaration * attrDecl
, DatatypeValidator * dv
);
void setValue(const XMLCh * const normalizedValue);
void updateValidity(VALIDITY_STATE newValue);
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
PSVIAttribute(const PSVIAttribute&);
PSVIAttribute & operator=(const PSVIAttribute &);
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
// fAttributeDecl
// attribute declaration component that validated this attribute
// fDV
// implementation-specific datatype validator used to validate this attribute
XSAttributeDeclaration * fAttributeDecl;
DatatypeValidator * fDV;
};
inline PSVIAttribute::~PSVIAttribute()
{
fMemoryManager->deallocate((void *)fCanonicalValue);
}
inline XSAttributeDeclaration *PSVIAttribute::getAttributeDeclaration()
{
return fAttributeDecl;
}
inline XSTypeDefinition* PSVIAttribute::getTypeDefinition()
{
return fType;
}
inline XSSimpleTypeDefinition* PSVIAttribute::getMemberTypeDefinition()
{
return fMemberType;
}
inline void PSVIAttribute::updateValidity(VALIDITY_STATE newValue)
{
fValidityState = newValue;
}
XERCES_CPP_NAMESPACE_END
#endif
PSVIItem::getMemberTypeDefinition
virtual XSSimpleTypeDefinition * getMemberTypeDefinition()=0
If and only if that type definition is a simple type definition with {variety} union,...
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
PSVIAttribute::getTypeDefinition
XSTypeDefinition * getTypeDefinition()
An item isomorphic to the type definition used to validate this element.
Definition: PSVIAttribute.hpp:162
PSVIAttribute
Definition: PSVIAttribute.hpp:41
XSAttributeDeclaration
Definition: XSAttributeDeclaration.hpp:42
PSVIItem::ASSESSMENT_TYPE
ASSESSMENT_TYPE
Definition: PSVIItem.hpp:65
PSVIItem
Definition: PSVIItem.hpp:41
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
PSVIItem::fMemoryManager
MemoryManager *const fMemoryManager
Definition: PSVIItem.hpp:258
PSVIAttribute::updateValidity
void updateValidity(VALIDITY_STATE newValue)
set VALIDITY_STATE to specified value; intended to be called by implementation.
Definition: PSVIAttribute.hpp:172
PSVIItem::getTypeDefinition
virtual XSTypeDefinition * getTypeDefinition()=0
An item isomorphic to the type definition used to validate this element.
PSVIAttribute::~PSVIAttribute
~PSVIAttribute()
Definition: PSVIAttribute.hpp:152
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:120
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition: PlatformUtils.hpp:121
XSTypeDefinition
This class represents a complexType or simpleType definition.
Definition: XSTypeDefinition.hpp:39
PSVIItem.hpp
PSVIAttribute::getAttributeDeclaration
XSAttributeDeclaration * getAttributeDeclaration()
An item isomorphic to the attribute declaration used to validate this attribute.
Definition: PSVIAttribute.hpp:157
XSSimpleTypeDefinition.hpp
PSVIItem::fValidityState
VALIDITY_STATE fValidityState
Definition: PSVIItem.hpp:263
PSVIItem::fMemberType
XSSimpleTypeDefinition * fMemberType
Definition: PSVIItem.hpp:267
MemoryManager::deallocate
virtual void deallocate(void *p)=0
This method deallocates memory.
PSVIItem::fType
XSTypeDefinition * fType
Definition: PSVIItem.hpp:266
PSVIAttribute::getMemberTypeDefinition
XSSimpleTypeDefinition * getMemberTypeDefinition()
If and only if that type definition is a simple type definition with {variety} union,...
Definition: PSVIAttribute.hpp:167
MemoryManager
Configurable memory manager.
Definition: MemoryManager.hpp:39
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition: XercesDefs.hpp:163
PSVIItem::reset
void reset(const XMLCh *const validationContext, const XMLCh *const normalizedValue, const VALIDITY_STATE validityState, const ASSESSMENT_TYPE assessmentType)
reset the object
PSVIItem::fCanonicalValue
XMLCh * fCanonicalValue
Definition: PSVIItem.hpp:262
PSVIItem::VALIDITY_STATE
VALIDITY_STATE
Definition: PSVIItem.hpp:45
XSSimpleTypeDefinition
Definition: XSSimpleTypeDefinition.hpp:43