Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:51

0001 /*
0002  * Licensed to the Apache Software Foundation (ASF) under one or more
0003  * contributor license agreements.  See the NOTICE file distributed with
0004  * this work for additional information regarding copyright ownership.
0005  * The ASF licenses this file to You under the Apache License, Version 2.0
0006  * (the "License"); you may not use this file except in compliance with
0007  * the License.  You may obtain a copy of the License at
0008  * 
0009  *      http://www.apache.org/licenses/LICENSE-2.0
0010  * 
0011  * Unless required by applicable law or agreed to in writing, software
0012  * distributed under the License is distributed on an "AS IS" BASIS,
0013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014  * See the License for the specific language governing permissions and
0015  * limitations under the License.
0016  */
0017 
0018 /*
0019  * $Id$
0020  */
0021 
0022 #if !defined(XERCESC_INCLUDE_GUARD_PSVIATTRIBUTE_HPP)
0023 #define XERCESC_INCLUDE_GUARD_PSVIATTRIBUTE_HPP
0024 
0025 #include <xercesc/framework/psvi/PSVIItem.hpp>
0026 #include <xercesc/framework/psvi/XSSimpleTypeDefinition.hpp>
0027 #include <xercesc/validators/datatype/DatatypeValidator.hpp>
0028 
0029 XERCES_CPP_NAMESPACE_BEGIN
0030 
0031 /**
0032  * Represent the PSVI contributions for one attribute information item.
0033  * This is *always* owned by the scanner/parser object from which
0034  * it is obtained.  The validator will specify 
0035  * under what conditions it may be relied upon to have meaningful contents.
0036  */
0037 
0038 // forward declarations
0039 class XSAttributeDeclaration;
0040 
0041 class XMLPARSER_EXPORT PSVIAttribute : public PSVIItem  
0042 {
0043 public:
0044 
0045     //  Constructors and Destructor
0046     // -----------------------------------------------------------------------
0047     /** @name Constructors */
0048     //@{
0049 
0050     /**
0051       * The default constructor 
0052       *
0053       * @param  manager     The configurable memory manager
0054       */
0055     PSVIAttribute( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
0056 
0057     //@};
0058 
0059     /** @name Destructor */
0060     //@{
0061     ~PSVIAttribute();
0062     //@}
0063 
0064     //---------------------
0065     /** @name PSVIAttribute methods */
0066 
0067     //@{
0068 
0069     /**
0070      * An item isomorphic to the attribute declaration used to validate
0071      * this attribute.
0072      * 
0073      * @return  an attribute declaration
0074      */
0075     XSAttributeDeclaration *getAttributeDeclaration();
0076     
0077     /**
0078      * An item isomorphic to the type definition used to validate this element.
0079      * 
0080      * @return  a type declaration
0081      */
0082     XSTypeDefinition *getTypeDefinition();
0083     
0084     /**
0085      * If and only if that type definition is a simple type definition
0086      * with {variety} union, or a complex type definition whose {content type}
0087      * is a simple thype definition with {variety} union, then an item isomorphic
0088      * to that member of the union's {member type definitions} which actually
0089      * validated the element item's normalized value.
0090      * 
0091      * @return  a simple type declaration
0092      */
0093     XSSimpleTypeDefinition *getMemberTypeDefinition();
0094     
0095     //@}
0096 
0097     //----------------------------------
0098     /** methods needed by implementation */
0099 
0100     //@{
0101 
0102     /**
0103       * reset this object.  Intended to be called by
0104       * the implementation.
0105       */
0106     void reset(
0107             const XMLCh * const         valContext
0108             , PSVIItem::VALIDITY_STATE  state
0109             , PSVIItem::ASSESSMENT_TYPE assessmentType
0110             , XSSimpleTypeDefinition *  validatingType
0111             , XSSimpleTypeDefinition *  memberType
0112             , const XMLCh * const       defaultValue
0113             , const bool                isSpecified
0114             , XSAttributeDeclaration *  attrDecl
0115             , DatatypeValidator *       dv
0116         );
0117 
0118     /**
0119       * set the schema normalized value (and
0120       * implicitly the canonical value) of this object; intended to be used
0121       * by the implementation.
0122       */
0123     void setValue(const XMLCh * const       normalizedValue);
0124 
0125     /**
0126       * set VALIDITY_STATE to specified value; intended to be
0127       * called by implementation.
0128       */
0129     void updateValidity(VALIDITY_STATE newValue);
0130 
0131     //@}
0132 
0133 private:
0134 
0135     // -----------------------------------------------------------------------
0136     //  Unimplemented constructors and operators
0137     // -----------------------------------------------------------------------
0138     PSVIAttribute(const PSVIAttribute&);
0139     PSVIAttribute & operator=(const PSVIAttribute &);
0140 
0141 
0142     // -----------------------------------------------------------------------
0143     //  data members
0144     // -----------------------------------------------------------------------
0145     // fAttributeDecl
0146     //      attribute declaration component that validated this attribute 
0147     // fDV
0148     //      implementation-specific datatype validator used to validate this attribute
0149     XSAttributeDeclaration *    fAttributeDecl;
0150     DatatypeValidator *         fDV;
0151 };
0152 inline PSVIAttribute::~PSVIAttribute() 
0153 {
0154     fMemoryManager->deallocate((void *)fCanonicalValue);
0155 }
0156 
0157 inline XSAttributeDeclaration *PSVIAttribute::getAttributeDeclaration() 
0158 {
0159     return fAttributeDecl;
0160 }
0161 
0162 inline XSTypeDefinition* PSVIAttribute::getTypeDefinition()
0163 {
0164     return fType;
0165 }
0166 
0167 inline XSSimpleTypeDefinition* PSVIAttribute::getMemberTypeDefinition() 
0168 {
0169     return fMemberType;
0170 }
0171 
0172 inline void PSVIAttribute::updateValidity(VALIDITY_STATE newValue)
0173 {
0174     fValidityState = newValue;
0175 }
0176 
0177 XERCES_CPP_NAMESPACE_END
0178 
0179 #endif