# XSAttributeDeclaration.hpp

Go to the documentation of this file.

    00001 /*
    00002  * Licensed to the Apache Software Foundation (ASF) under one or more
    00003  * contributor license agreements.  See the NOTICE file distributed with
    00004  * this work for additional information regarding copyright ownership.
    00005  * The ASF licenses this file to You under the Apache License, Version 2.0
    00006  * (the "License"); you may not use this file except in compliance with
    00007  * the License.  You may obtain a copy of the License at
    00008  *
    00009  *      http://www.apache.org/licenses/LICENSE-2.0
    00010  *
    00011  * Unless required by applicable law or agreed to in writing, software
    00012  * distributed under the License is distributed on an "AS IS" BASIS,
    00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00014  * See the License for the specific language governing permissions and
    00015  * limitations under the License.
    00016  */
    00017
    00018 /*
    00019  * $Id: XSAttributeDeclaration.hpp 527149 2007-04-10 14:56:39Z amassari $
    00020  */
    00021
    00022 #if !defined(XERCESC_INCLUDE_GUARD_XSATTRIBUTEDECLARATION_HPP)
    00023 #define XERCESC_INCLUDE_GUARD_XSATTRIBUTEDECLARATION_HPP
    00024
    00025 #include <xercesc/framework/psvi/XSObject.hpp>
    00026
    00027 XERCES_CPP_NAMESPACE_BEGIN
    00028
    00036 // forward declarations
    00037 class XSAnnotation;
    00038 class XSComplexTypeDefinition;
    00039 class XSSimpleTypeDefinition;
    00040 class SchemaAttDef;
    00041
    00042 class XMLPARSER_EXPORT XSAttributeDeclaration : public XSObject
    00043 {
    00044 public:
    00045
    00046     //  Constructors and Destructor
    00047     // -----------------------------------------------------------------------
    00050
    00062     XSAttributeDeclaration
    00063     (
    00064         SchemaAttDef* const             attDef
    00065         , XSSimpleTypeDefinition* const typeDef
    00066         , XSAnnotation* const           annot
    00067         , XSModel* const                xsModel
    00068         , XSConstants::SCOPE            scope
    00069         , XSComplexTypeDefinition*      enclosingCTDefinition
    00070         , MemoryManager* const          manager = XMLPlatformUtils::fgMemoryManager
    00071     );
    00072
    00074
    00077     ~XSAttributeDeclaration();
    00079
    00080     //---------------------
    00084
    00089     const XMLCh* getName() const;
    00090
    00095     const XMLCh* getNamespace();
    00096
    00102     XSNamespaceItem* getNamespaceItem();
    00103
    00105
    00109
    00113     XSSimpleTypeDefinition *getTypeDefinition() const;
    00114
    00120     XSConstants::SCOPE getScope() const;
    00121
    00126     XSComplexTypeDefinition *getEnclosingCTDefinition();
    00127
    00131     XSConstants::VALUE_CONSTRAINT getConstraintType() const;
    00132
    00137     const XMLCh *getConstraintValue();
    00138
    00142     XSAnnotation *getAnnotation() const;
    00143
    00145
    00146     //----------------------------------
    00150
    00151     bool getRequired() const;
    00153
    00154 private:
    00155
    00156     void setEnclosingCTDefinition(XSComplexTypeDefinition* const toSet);
    00157     friend class XSObjectFactory;
    00158
    00159     // -----------------------------------------------------------------------
    00160     //  Unimplemented constructors and operators
    00161     // -----------------------------------------------------------------------
    00162     XSAttributeDeclaration(const XSAttributeDeclaration&);
    00163     XSAttributeDeclaration & operator=(const XSAttributeDeclaration &);
    00164
    00165 protected:
    00166
    00167     // -----------------------------------------------------------------------
    00168     //  data members
    00169     // -----------------------------------------------------------------------
    00170     SchemaAttDef*               fAttDef;
    00171     XSSimpleTypeDefinition*     fTypeDefinition;
    00172     XSAnnotation*               fAnnotation;
    00173     XSConstants::SCOPE          fScope;
    00174     XSComplexTypeDefinition*    fEnclosingCTDefinition;
    00175 };
    00176
    00177 // ---------------------------------------------------------------------------
    00178 //  XSAttributeDeclaration: inline methods
    00179 // ---------------------------------------------------------------------------
    00180 inline XSSimpleTypeDefinition* XSAttributeDeclaration::getTypeDefinition() const
    00181 {
    00182     return fTypeDefinition;
    00183 }
    00184
    00185 inline XSAnnotation *XSAttributeDeclaration::getAnnotation() const
    00186 {
    00187     return fAnnotation;
    00188 }
    00189
    00190 inline XSConstants::SCOPE XSAttributeDeclaration::getScope() const
    00191 {
    00192     return fScope;
    00193 }
    00194
    00195 inline XSComplexTypeDefinition *XSAttributeDeclaration::getEnclosingCTDefinition()
    00196 {
    00197     return fEnclosingCTDefinition;
    00198 }
    00199
    00200 inline void XSAttributeDeclaration::setEnclosingCTDefinition
    00201 (
    00202     XSComplexTypeDefinition* const toSet
    00203 )
    00204 {
    00205     fEnclosingCTDefinition = toSet;
    00206 }
    00207
    00208 XERCES_CPP_NAMESPACE_END
    00209
    00210 #endif