source: NonGTP/Xerces/xerces-c_2_8_0/include/xercesc/framework/psvi/PSVIElement.hpp @ 2674

Revision 2674, 5.2 KB checked in by mattausch, 16 years ago (diff)
Line 
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id: PSVIElement.hpp 568078 2007-08-21 11:43:25Z amassari $
20 */
21
22#if !defined(PSVIELEMENT_HPP)
23#define PSVIELEMENT_HPP
24
25#include <xercesc/framework/psvi/PSVIItem.hpp>
26
27XERCES_CPP_NAMESPACE_BEGIN
28
29/**
30 * Represent the PSVI contributions for one element information item.
31 * This is *always* owned by the scanner/parser object from which
32 * it is obtained.  The validator will specify
33 * under what conditions it may be relied upon to have meaningful contents.
34 */
35
36// forward declarations
37class XSElementDeclaration;
38class XSNotationDeclaration;
39class XSModel;
40
41class XMLPARSER_EXPORT PSVIElement : public PSVIItem 
42{
43public:
44
45    //  Constructors and Destructor
46    // -----------------------------------------------------------------------
47    /** @name Constructors */
48    //@{
49
50    /**
51      * The default constructor
52      *
53      * @param  manager     The configurable memory manager
54      */
55    PSVIElement( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
56
57    //@};
58
59    /** @name Destructor */
60    //@{
61    ~PSVIElement();
62    //@}
63
64    //---------------------
65    /** @name PSVIElement methods */
66
67    //@{
68
69    /**
70     * An item isomorphic to the element declaration used to validate
71     * this element.
72     *
73     * @return  an element declaration
74     */
75    XSElementDeclaration *getElementDeclaration();
76   
77    /**
78     * [notation]
79     * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-notation">XML Schema Part 1: Structures [notation]</a>
80     * @return The notation declaration.
81     */
82    XSNotationDeclaration *getNotationDeclaration();
83
84    /**
85     * [schema information]
86     * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_information">XML Schema Part 1: Structures [schema information]</a>
87     * @return The schema information property if it's the validation root,
88     *         null otherwise.
89     */
90    XSModel *getSchemaInformation();
91   
92    /**
93     * An item isomorphic to the type definition used to validate this element.
94     *
95     * @return  a type declaration
96     */
97    XSTypeDefinition *getTypeDefinition();
98   
99    /**
100     * If and only if that type definition is a simple type definition
101     * with {variety} union, or a complex type definition whose {content type}
102     * is a simple type definition with {variety} union, then an item isomorphic
103     * to that member of the union's {member type definitions} which actually
104     * validated the element item's normalized value.
105     *
106     * @return  a simple type declaration
107     */
108    XSSimpleTypeDefinition *getMemberTypeDefinition();
109   
110    //@}
111
112    //----------------------------------
113    /** methods needed by implementation */
114
115    //@{
116    void reset
117    (
118        const VALIDITY_STATE            validityState
119        , const ASSESSMENT_TYPE         assessmentType
120        , const XMLCh* const            validationContext
121        , bool                          isSpecified
122        , XSElementDeclaration* const   elemDecl
123        , XSTypeDefinition* const       typeDef
124        , XSSimpleTypeDefinition* const memberType
125        , XSModel* const                schemaInfo
126        , const XMLCh* const            defaultValue
127        , const XMLCh* const            normalizedValue = 0
128        , XMLCh* const                  canonicalValue = 0
129        , XSNotationDeclaration* const  notationDecl = 0
130    );
131
132    //@}
133
134private:
135
136    // -----------------------------------------------------------------------
137    //  Unimplemented constructors and operators
138    // -----------------------------------------------------------------------
139    PSVIElement(const PSVIElement&);
140    PSVIElement & operator=(const PSVIElement &);
141
142
143    // -----------------------------------------------------------------------
144    //  data members
145    // -----------------------------------------------------------------------
146    // fElementDecl
147    //  element declaration component that validated this element
148    // fNotationDecl
149    //  (optional) notation decl associated with this element
150    // fSchemaInfo
151    //  Schema Information Item with which this validation episode is associated
152    XSElementDeclaration *fElementDecl;
153    XSNotationDeclaration *fNotationDecl;
154    XSModel *fSchemaInfo;
155};
156
157inline XSElementDeclaration *PSVIElement::getElementDeclaration()
158{
159    return fElementDecl;
160}
161
162inline XSNotationDeclaration* PSVIElement::getNotationDeclaration()
163{
164    return fNotationDecl;
165}
166
167inline XSModel* PSVIElement::getSchemaInformation()
168{
169    return fSchemaInfo;
170}
171
172XERCES_CPP_NAMESPACE_END
173
174#endif
Note: See TracBrowser for help on using the repository browser.