- Main Page
- Related Pages
- Classes
- Files

# XSNamespaceItem.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: XSNamespaceItem.hpp 527149 2007-04-10 14:56:39Z amassari $
    00020  */
    00021
    00022 #if !defined(XERCESC_INCLUDE_GUARD_XSNAMESPACEITEM_HPP)
    00023 #define XERCESC_INCLUDE_GUARD_XSNAMESPACEITEM_HPP
    00024
    00025 #include <xercesc/util/PlatformUtils.hpp>
    00026 #include <xercesc/framework/psvi/XSObject.hpp>
    00027 #include <xercesc/framework/psvi/XSNamedMap.hpp>
    00028
    00029 XERCES_CPP_NAMESPACE_BEGIN
    00030
    00042 // forward declarations
    00043 class XSAnnotation;
    00044 class XSAttributeDeclaration;
    00045 class XSAttributeGroupDefinition;
    00046 class XSElementDeclaration;
    00047 class XSModelGroupDefinition;
    00048 class XSNotationDeclaration;
    00049 class XSTypeDefinition;
    00050 class SchemaGrammar;
    00051 class XSModel;
    00052
    00053 class XMLPARSER_EXPORT XSNamespaceItem : public XMemory
    00054 {
    00055 public:
    00056
    00057     //  Constructors and Destructor
    00058     // -----------------------------------------------------------------------
    00061
    00069     XSNamespaceItem
    00070     (
    00071         XSModel* const         xsModel
    00072         , SchemaGrammar* const grammar
    00073         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
    00074     );
    00075
    00076     XSNamespaceItem
    00077     (
    00078         XSModel* const         xsModel
    00079         , const XMLCh* const   schemaNamespace
    00080         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
    00081     );
    00082
    00084
    00087     ~XSNamespaceItem();
    00089
    00090     //---------------------
    00094
    00099     const XMLCh *getSchemaNamespace() const;
    00100
    00111     XSNamedMap<XSObject> *getComponents(XSConstants::COMPONENT_TYPE objectType);
    00112
    00116     XSAnnotationList *getAnnotations();
    00117     const XSAnnotationList *getAnnotations() const;
    00118
    00125     XSElementDeclaration *getElementDeclaration(const XMLCh *name);
    00126
    00133     XSAttributeDeclaration *getAttributeDeclaration(const XMLCh *name);
    00134
    00142     XSTypeDefinition *getTypeDefinition(const XMLCh *name);
    00143
    00150     XSAttributeGroupDefinition *getAttributeGroup(const XMLCh *name);
    00151
    00158     XSModelGroupDefinition *getModelGroupDefinition(const XMLCh *name);
    00159
    00166     XSNotationDeclaration *getNotationDeclaration(const XMLCh *name);
    00167
    00172     const StringList *getDocumentLocations();
    00173
    00175
    00176     //----------------------------------
    00180
    00181
    00183 private:
    00184
    00185     // -----------------------------------------------------------------------
    00186     //  Unimplemented constructors and operators
    00187     // -----------------------------------------------------------------------
    00188     XSNamespaceItem(const XSNamespaceItem&);
    00189     XSNamespaceItem & operator=(const XSNamespaceItem &);
    00190
    00191 protected:
    00192     friend class XSModel;
    00193     friend class XSObjectFactory;
    00194     // -----------------------------------------------------------------------
    00195     //  data members
    00196     // -----------------------------------------------------------------------
    00197     // fMemoryManager:
    00198     //  used for any memory allocations
    00199     MemoryManager* const    fMemoryManager;
    00200     SchemaGrammar*          fGrammar;
    00201     XSModel*                fXSModel;
    00202
    00203     /* Need a XSNamedMap for each component    top-level?
    00204        that is top level.
    00205           ATTRIBUTE_DECLARATION     = 1,
    00206           ELEMENT_DECLARATION       = 2,
    00207           TYPE_DEFINITION           = 3,
    00208           ATTRIBUTE_USE             = 4,       no
    00209           ATTRIBUTE_GROUP_DEFINITION= 5,
    00210           MODEL_GROUP_DEFINITION    = 6,
    00211           MODEL_GROUP               = 7,       no
    00212           PARTICLE                  = 8,       no
    00213           WILDCARD                  = 9,       no
    00214           IDENTITY_CONSTRAINT       = 10,      no
    00215           NOTATION_DECLARATION      = 11,
    00216           ANNOTATION                = 12,      no
    00217           FACET                     = 13,      no
    00218           MULTIVALUE_FACET          = 14       no
    00219     */
    00220     XSNamedMap<XSObject>*                   fComponentMap[XSConstants::MULTIVALUE_FACET];
    00221     XSAnnotationList*                       fXSAnnotationList;
    00222     RefHashTableOf<XSObject>*               fHashMap[XSConstants::MULTIVALUE_FACET];
    00223     const XMLCh*                            fSchemaNamespace;
    00224 };
    00225
    00226 inline XSAnnotationList* XSNamespaceItem::getAnnotations()
    00227 {
    00228     return fXSAnnotationList;
    00229 }
    00230
    00231 inline const XSAnnotationList* XSNamespaceItem::getAnnotations() const
    00232 {
    00233     return fXSAnnotationList;
    00234 }
    00235
    00236 inline const XMLCh *XSNamespaceItem::getSchemaNamespace() const
    00237 {
    00238     return fSchemaNamespace;
    00239 }
    00240
    00241
    00242
    00243 XERCES_CPP_NAMESPACE_END
    00244
    00245 #endif