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 #if !defined(XERCESC_INCLUDE_GUARD_DOMTYPEINFO_HPP)
0019 #define XERCESC_INCLUDE_GUARD_DOMTYPEINFO_HPP
0020 
0021 //------------------------------------------------------------------------------------
0022 //  Includes
0023 //------------------------------------------------------------------------------------
0024 #include <xercesc/util/XMLString.hpp>
0025 
0026 
0027 XERCES_CPP_NAMESPACE_BEGIN
0028 
0029 /**
0030   * The <code>DOMTypeInfo</code> interface represent a type used by
0031   * <code>DOMElement</code> or <code>DOMAttr</code> nodes, specified in the
0032   * schemas associated with the document. The type is a pair of a namespace URI
0033   * and name properties, and depends on the document's schema.
0034   */
0035 class CDOM_EXPORT DOMTypeInfo
0036 {
0037 protected:
0038     // -----------------------------------------------------------------------
0039     //  Hidden constructors
0040     // -----------------------------------------------------------------------
0041     /** @name Hidden constructors */
0042     //@{
0043     DOMTypeInfo() {};
0044     //@}
0045 
0046 private:
0047     // -----------------------------------------------------------------------
0048     // Unimplemented constructors and operators
0049     // -----------------------------------------------------------------------
0050     /** @name Unimplemented constructors and operators */
0051     //@{
0052     DOMTypeInfo(const DOMTypeInfo &);
0053     DOMTypeInfo & operator = (const DOMTypeInfo &);
0054     //@}
0055 
0056 public:
0057 
0058     // -----------------------------------------------------------------------
0059     //  All constructors are hidden, just the destructor is available
0060     // -----------------------------------------------------------------------
0061     /** @name Destructor */
0062     //@{
0063     /**
0064      * Destructor
0065      *
0066      */
0067     virtual ~DOMTypeInfo() {};
0068     //@}
0069 
0070     // -----------------------------------------------------------------------
0071     //  Class Types
0072     // -----------------------------------------------------------------------
0073     /** @name Public Contants */
0074     //@{
0075     /**
0076      * These are the available values for the derivationMethod parameter used by the
0077      * method <code>DOMTypeInfo::isDerivedFrom()</code>. It is a set of possible types
0078      * of derivation, and the values represent bit positions. If a bit in the derivationMethod
0079      * parameter is set to 1, the corresponding type of derivation will be taken into account
0080      * when evaluating the derivation between the reference type definition and the other type
0081      * definition. When using the isDerivedFrom method, combining all of them in the
0082      * derivationMethod parameter is equivalent to invoking the method for each of them separately
0083      * and combining the results with the OR boolean function. This specification only defines
0084      * the type of derivation for XML Schema.
0085      *
0086      * In addition to the types of derivation listed below, please note that:
0087      *  - any type derives from xsd:anyType.
0088      *  - any simple type derives from xsd:anySimpleType by restriction.
0089      *  - any complex type does not derive from xsd:anySimpleType by restriction.
0090      *
0091      * <p><code>DERIVATION_EXTENSION:</code>
0092      * If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the
0093      * derivation by extension. The reference type definition is derived by extension from the other
0094      * type definition if the other type definition can be reached recursively following the
0095      * {base type definition} property from the reference type definition, and at least one of the
0096      * derivation methods involved is an extension.</p>
0097      *
0098      * <p><code>DERIVATION_LIST:</code>
0099      * If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the list.
0100      * The reference type definition is derived by list from the other type definition if there exists
0101      * two type definitions T1 and T2 such as the reference type definition is derived from T1 by
0102      * DERIVATION_RESTRICTION or DERIVATION_EXTENSION, T2 is derived from the other type definition by
0103      * DERIVATION_RESTRICTION, T1 has {variety} list, and T2 is the {item type definition}. Note that
0104      * T1 could be the same as the reference type definition, and T2 could be the same as the other
0105      * type definition.</p>
0106      *
0107      * <p><code>DERIVATION_RESTRICTION:</code>
0108      * If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the
0109      * derivation by restriction if complex types are involved, or a restriction if simple types are
0110      * involved.
0111      * The reference type definition is derived by restriction from the other type definition if the
0112      * other type definition is the same as the reference type definition, or if the other type definition
0113      * can be reached recursively following the {base type definition} property from the reference type
0114      * definition, and all the derivation methods involved are restriction.</p>
0115      *
0116      * <p><code>DERIVATION_UNION:</code>
0117      * If the document's schema is an XML Schema [XML Schema Part 1], this constant represents the union
0118      * if simple types are involved.
0119      * The reference type definition is derived by union from the other type definition if there exists
0120      * two type definitions T1 and T2 such as the reference type definition is derived from T1 by
0121      * DERIVATION_RESTRICTION or DERIVATION_EXTENSION, T2 is derived from the other type definition by
0122      * DERIVATION_RESTRICTION, T1 has {variety} union, and one of the {member type definitions} is T2.
0123      * Note that T1 could be the same as the reference type definition, and T2 could be the same as the
0124      * other type definition.</p>
0125      *
0126      * @since DOM Level 3
0127      *
0128      */
0129     enum DerivationMethods {
0130          DERIVATION_RESTRICTION = 0x001,
0131          DERIVATION_EXTENSION   = 0x002,
0132          DERIVATION_UNION       = 0x004,
0133          DERIVATION_LIST        = 0x008
0134         };
0135     //@}
0136 
0137     //@{
0138     // -----------------------------------------------------------------------
0139     //  Getter methods
0140     // -----------------------------------------------------------------------
0141     /**
0142      * Returns The name of a type declared for the associated <code>DOMElement</code>
0143      * or <code>DOMAttr</code>, or null if unknown.
0144      *
0145      * @return The name of a type declared for the associated <code>DOMElement</code>
0146      * or <code>DOMAttribute</code>, or null if unknown.
0147      * @since DOM level 3
0148      */
0149     virtual const XMLCh* getTypeName() const = 0;
0150 
0151     /**
0152      * The namespace of the type declared for the associated <code>DOMElement</code>
0153      * or <code>DOMAttr</code> or null if the <code>DOMElement</code> does not have
0154      * declaration or if no namespace information is available.
0155      *
0156      * @return The namespace of the type declared for the associated <code>DOMElement</code>
0157      * or <code>DOMAttr</code> or null if the <code>DOMElement</code> does not have
0158      * declaration or if no namespace information is available.
0159      * @since DOM level 3
0160      */
0161     virtual const XMLCh* getTypeNamespace() const = 0;
0162     //@}
0163 
0164     //@{
0165     /**
0166      * This method returns if there is a derivation between the reference type definition,
0167      * i.e. the DOMTypeInfo on which the method is being called, and the other type definition,
0168      * i.e. the one passed as parameters.
0169      *
0170      * @param typeNamespaceArg The namespace of the other type definition.
0171      * @param typeNameArg The name of the other type definition.
0172      * @param derivationMethod The type of derivation and conditions applied between two types,
0173      *                         as described in the list of constants provided in this interface.
0174      * @return If the document's schema is a DTD or no schema is associated with the document,
0175      *         this method will always return false.
0176      *         If the document's schema is an XML Schema, the method will true if the reference
0177      *         type definition is derived from the other type definition according to the derivation
0178      *         parameter. If the value of the parameter is 0 (no bit is set to 1 for the
0179      *         derivationMethod parameter), the method will return true if the other type definition
0180      *         can be reached by recursing any combination of {base type definition},
0181      *         {item type definition}, or {member type definitions} from the reference type definition.
0182      * @since DOM level 3
0183      */
0184     virtual bool isDerivedFrom(const XMLCh* typeNamespaceArg,
0185                                const XMLCh* typeNameArg,
0186                                DerivationMethods derivationMethod) const = 0;
0187     //@}
0188 };
0189 
0190 XERCES_CPP_NAMESPACE_END
0191 
0192 #endif
0193 
0194 /**
0195  * End of file DOMTypeInfo.hpp
0196  */