Back to home page

EIC code displayed by LXR

 
 

    


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

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_XSWILDCARD_HPP)
0023 #define XERCESC_INCLUDE_GUARD_XSWILDCARD_HPP
0024 
0025 #include <xercesc/framework/psvi/XSObject.hpp>
0026 
0027 XERCES_CPP_NAMESPACE_BEGIN
0028 
0029 /**
0030  * This class describes all properties of a Schema Wildcard
0031  * component.
0032  * This is *always* owned by the validator /parser object from which
0033  * it is obtained.  
0034  */
0035 
0036 // forward declarations
0037 class XSAnnotation;
0038 class SchemaAttDef;
0039 class ContentSpecNode;
0040 
0041 class XMLPARSER_EXPORT XSWildcard : public XSObject
0042 {
0043 public:
0044 
0045     // Namespace Constraint
0046     enum NAMESPACE_CONSTRAINT {
0047         /**
0048          * Namespace Constraint: any namespace is allowed.
0049          */
0050         NSCONSTRAINT_ANY          = 1,
0051         /**
0052          * Namespace Constraint: namespaces in the list are not allowed.
0053          */
0054         NSCONSTRAINT_NOT          = 2,
0055         /**
0056          * Namespace Constraint: namespaces in the list are allowed.
0057          */
0058         NSCONSTRAINT_DERIVATION_LIST         = 3
0059     };
0060 
0061     // Process contents
0062     enum PROCESS_CONTENTS {
0063         /**
0064          * There must be a top-level declaration for the item available, or the 
0065          * item must have an xsi:type, and the item must be valid as appropriate.
0066          */
0067         PC_STRICT                 = 1,
0068         /**
0069          * No constraints at all: the item must simply be well-formed XML. 
0070          */
0071         PC_SKIP                   = 2,
0072         /**
0073          * If the item, or any items among its [children] is an element 
0074          * information item, has a uniquely determined declaration available, it 
0075          * must be valid with respect to that definition, that is, validate 
0076          * where you can, don't worry when you can't.
0077          */
0078         PC_LAX                    = 3
0079     };
0080 
0081     //  Constructors and Destructor
0082     // -----------------------------------------------------------------------
0083     /** @name Constructors */
0084     //@{
0085 
0086     /**
0087       * The default constructor 
0088       *
0089       * @param  attWildCard
0090       * @param  annot
0091       * @param  xsModel
0092       * @param  manager     The configurable memory manager
0093       */
0094     XSWildcard
0095     (
0096         SchemaAttDef* const attWildCard
0097         , XSAnnotation* const annot
0098         , XSModel* const xsModel
0099         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0100     );
0101     
0102     XSWildcard
0103     (
0104         const ContentSpecNode* const elmWildCard
0105         , XSAnnotation* const annot
0106         , XSModel* const xsModel
0107         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0108     );
0109 
0110     //@}
0111 
0112     /** @name Destructor */
0113     //@{
0114     ~XSWildcard();
0115     //@}
0116 
0117     //---------------------
0118     /** @name XSWildcard methods */
0119 
0120     //@{
0121 
0122     /**
0123      * Namespace constraint: A constraint type: any, not, list. 
0124      */
0125     NAMESPACE_CONSTRAINT getConstraintType() const;
0126 
0127     /**
0128      * Namespace constraint. For <code>constraintType</code> 
0129      * <code>NSCONSTRAINT_DERIVATION_LIST</code>, the list contains allowed namespaces. 
0130      * For <code>constraintType</code> <code>NSCONSTRAINT_NOT</code>, the 
0131      * list contains disallowed namespaces. 
0132      */
0133     StringList *getNsConstraintList();
0134 
0135     /**
0136      * [process contents]: one of skip, lax or strict. Valid constants values 
0137      * are: <code>PC_SKIP, PC_LAX, PC_STRICT</code>. 
0138      */
0139     PROCESS_CONTENTS getProcessContents() const;
0140 
0141     /**
0142      * Optional. An [annotation]. 
0143      */
0144     XSAnnotation *getAnnotation() const;
0145 
0146     //@}
0147 
0148     //----------------------------------
0149     /** methods needed by implementation */
0150 
0151     //@{
0152 
0153     //@}
0154 private:
0155 
0156     // -----------------------------------------------------------------------
0157     //  Unimplemented constructors and operators
0158     // -----------------------------------------------------------------------
0159     XSWildcard(const XSWildcard&);
0160     XSWildcard & operator=(const XSWildcard &);
0161 
0162    /**
0163      * Build namespace list
0164      */
0165    void buildNamespaceList(const ContentSpecNode* const rootNode);
0166 
0167 protected:
0168 
0169     // -----------------------------------------------------------------------
0170     //  data members
0171     // -----------------------------------------------------------------------
0172     NAMESPACE_CONSTRAINT fConstraintType;
0173     PROCESS_CONTENTS     fProcessContents;
0174     StringList*          fNsConstraintList;
0175     XSAnnotation*        fAnnotation;
0176 };
0177 
0178 inline XSAnnotation *XSWildcard::getAnnotation() const
0179 {
0180     return fAnnotation;
0181 }
0182 
0183 inline XSWildcard::PROCESS_CONTENTS XSWildcard::getProcessContents() const
0184 {
0185     return fProcessContents;
0186 }
0187 
0188 inline StringList* XSWildcard::getNsConstraintList()
0189 {
0190     return fNsConstraintList;
0191 }
0192 
0193 inline XSWildcard::NAMESPACE_CONSTRAINT XSWildcard::getConstraintType() const
0194 {
0195     return fConstraintType;
0196 }
0197 
0198 
0199 XERCES_CPP_NAMESPACE_END
0200 
0201 #endif