source: NonGTP/Xerces/xercesc/framework/psvi/PSVIElement.hpp @ 188

Revision 188, 8.3 KB checked in by mattausch, 19 years ago (diff)

added xercesc to support

Line 
1/*
2 * The Apache Software License, Version 1.1
3 *
4 * Copyright (c) 2003 The Apache Software Foundation.  All rights
5 * reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 *    notice, this list of conditions and the following disclaimer.
13 *
14 * 2. Redistributions in binary form must reproduce the above copyright
15 *    notice, this list of conditions and the following disclaimer in
16 *    the documentation and/or other materials provided with the
17 *    distribution.
18 *
19 * 3. The end-user documentation included with the redistribution,
20 *    if any, must include the following acknowledgment:
21 *       "This product includes software developed by the
22 *        Apache Software Foundation (http://www.apache.org/)."
23 *    Alternately, this acknowledgment may appear in the software itself,
24 *    if and wherever such third-party acknowledgments normally appear.
25 *
26 * 4. The names "Xerces" and "Apache Software Foundation" must
27 *    not be used to endorse or promote products derived from this
28 *    software without prior written permission. For written
29 *    permission, please contact apache\@apache.org.
30 *
31 * 5. Products derived from this software may not be called "Apache",
32 *    nor may "Apache" appear in their name, without prior written
33 *    permission of the Apache Software Foundation.
34 *
35 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
36 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
37 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
38 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
39 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
42 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
45 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 * SUCH DAMAGE.
47 * ====================================================================
48 *
49 * This software consists of voluntary contributions made by many
50 * individuals on behalf of the Apache Software Foundation, and was
51 * originally based on software copyright (c) 1999, International
52 * Business Machines, Inc., http://www.ibm.com .  For more information
53 * on the Apache Software Foundation, please see
54 * <http://www.apache.org/>.
55 */
56
57/*
58 * $Log: PSVIElement.hpp,v $
59 * Revision 1.6  2003/11/28 21:18:31  knoaman
60 * Make use of canonical representation in PSVIElement
61 *
62 * Revision 1.5  2003/11/27 22:52:37  knoaman
63 * PSVIElement implementation
64 *
65 * Revision 1.4  2003/11/21 22:34:45  neilg
66 * More schema component model implementation, thanks to David Cargill.
67 * In particular, this cleans up and completes the XSModel, XSNamespaceItem,
68 * XSAttributeDeclaration and XSAttributeGroup implementations.
69 *
70 * Revision 1.3  2003/11/06 21:50:33  neilg
71 * fix compilation errors under gcc 3.3.
72 *
73 * Revision 1.2  2003/11/06 15:30:04  neilg
74 * first part of PSVI/schema component model implementation, thanks to David Cargill.  This covers setting the PSVIHandler on parser objects, as well as implementing XSNotation, XSSimpleTypeDefinition, XSIDCDefinition, and most of XSWildcard, XSComplexTypeDefinition, XSElementDeclaration, XSAttributeDeclaration and XSAttributeUse.
75 *
76 * Revision 1.1  2003/09/16 14:33:36  neilg
77 * PSVI/schema component model classes, with Makefile/configuration changes necessary to build them
78 *
79 */
80
81#if !defined(PSVIELEMENT_HPP)
82#define PSVIELEMENT_HPP
83
84#include <xercesc/framework/psvi/PSVIItem.hpp>
85
86XERCES_CPP_NAMESPACE_BEGIN
87
88/**
89 * Represent the PSVI contributions for one element information item.
90 * This is *always* owned by the scanner/parser object from which
91 * it is obtained.  The validator will specify
92 * under what conditions it may be relied upon to have meaningful contents.
93 */
94
95// forward declarations
96class XSElementDeclaration;
97class XSNotationDeclaration;
98class XSModel;
99
100class XMLPARSER_EXPORT PSVIElement : public PSVIItem 
101{
102public:
103
104    //  Constructors and Destructor
105    // -----------------------------------------------------------------------
106    /** @name Constructors */
107    //@{
108
109    /**
110      * The default constructor
111      *
112      * @param  manager     The configurable memory manager
113      */
114    PSVIElement( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
115
116    //@};
117
118    /** @name Destructor */
119    //@{
120    ~PSVIElement();
121    //@}
122
123    //---------------------
124    /** @name PSVIElement methods */
125
126    //@{
127
128    /**
129     * An item isomorphic to the element declaration used to validate
130     * this element.
131     *
132     * @return  an element declaration
133     */
134    XSElementDeclaration *getElementDeclaration();
135   
136    /**
137     * [notation]
138     * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-notation">XML Schema Part 1: Structures [notation]</a>
139     * @return The notation declaration.
140     */
141    XSNotationDeclaration *getNotationDeclaration();
142
143    /**
144     * [schema information]
145     * @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_information">XML Schema Part 1: Structures [schema information]</a>
146     * @return The schema information property if it's the validation root,
147     *         null otherwise.
148     */
149    XSModel *getSchemaInformation();
150   
151    /**
152     * An item isomorphic to the type definition used to validate this element.
153     *
154     * @return  a type declaration
155     */
156    XSTypeDefinition *getTypeDefinition();
157   
158    /**
159     * If and only if that type definition is a simple type definition
160     * with {variety} union, or a complex type definition whose {content type}
161     * is a simple type definition with {variety} union, then an item isomorphic
162     * to that member of the union's {member type definitions} which actually
163     * validated the element item's normalized value.
164     *
165     * @return  a simple type declaration
166     */
167    XSSimpleTypeDefinition *getMemberTypeDefinition();
168   
169    //@}
170
171    //----------------------------------
172    /** methods needed by implementation */
173
174    //@{
175    void reset
176    (
177        const VALIDITY_STATE            validityState
178        , const ASSESSMENT_TYPE         assessmentType
179        , const XMLCh* const            validationContext
180        , bool                          isSpecified
181        , XSElementDeclaration* const   elemDecl
182        , XSTypeDefinition* const       typeDef
183        , XSSimpleTypeDefinition* const memberType
184        , XSModel* const                schemaInfo
185        , const XMLCh* const            defaultValue
186        , const XMLCh* const            normalizedValue = 0
187        , XMLCh* const                  canonicalValue = 0
188        , XSNotationDeclaration* const  notationDecl = 0
189    );
190
191    //@}
192
193private:
194
195    // -----------------------------------------------------------------------
196    //  Unimplemented constructors and operators
197    // -----------------------------------------------------------------------
198    PSVIElement(const PSVIElement&);
199    PSVIElement & operator=(const PSVIElement &);
200
201
202    // -----------------------------------------------------------------------
203    //  data members
204    // -----------------------------------------------------------------------
205    // fElementDecl
206    //  element declaration component that validated this element
207    // fNotationDecl
208    //  (optional) notation decl associated with this element
209    // fSchemaInfo
210    //  Schema Information Item with which this validation episode is associated
211    XSElementDeclaration *fElementDecl;
212    XSNotationDeclaration *fNotationDecl;
213    XSModel *fSchemaInfo;
214};
215
216inline XSElementDeclaration *PSVIElement::getElementDeclaration()
217{
218    return fElementDecl;
219}
220
221inline XSNotationDeclaration* PSVIElement::getNotationDeclaration()
222{
223    return fNotationDecl;
224}
225
226inline XSModel* PSVIElement::getSchemaInformation()
227{
228    return fSchemaInfo;
229}
230
231XERCES_CPP_NAMESPACE_END
232
233#endif
Note: See TracBrowser for help on using the repository browser.