source: icXML/icXML-devel/src/xercesc/validators/schema/identity/IdentityConstraintHandler.hpp @ 2722

Last change on this file since 2722 was 2722, checked in by cameron, 6 years ago

Original Xerces files with import mods for icxercesc

File size: 6.0 KB
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: IdentityConstraintHandler.hpp 932887 2010-04-11 13:04:59Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_IDENTITYCONSTRAINT_HANDLER_HPP)
23#define XERCESC_INCLUDE_GUARD_IDENTITYCONSTRAINT_HANDLER_HPP
24
25// ---------------------------------------------------------------------------
26//  Includes
27// ---------------------------------------------------------------------------
28#include <xercesc/validators/schema/identity/ValueStoreCache.hpp>
29#include <xercesc/validators/schema/identity/XPathMatcherStack.hpp>
30
31XERCES_CPP_NAMESPACE_BEGIN
32
33// ---------------------------------------------------------------------------
34//  Forward Declarations
35// ---------------------------------------------------------------------------
36
37class XMLScanner;
38class FieldActivator;
39class MemoryManager;
40class XMLElementDecl;
41
42class VALIDATORS_EXPORT IdentityConstraintHandler: public XMemory
43{
44public:
45
46    // -----------------------------------------------------------------------
47    //  Constructors/Destructor
48    // -----------------------------------------------------------------------
49        virtual ~IdentityConstraintHandler();
50
51    IdentityConstraintHandler
52              (
53               XMLScanner*   const scanner
54             , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
55              );
56
57    // -----------------------------------------------------------------------
58    //  Getter methods
59    // -----------------------------------------------------------------------
60    inline  XMLSize_t    getMatcherCount() const;
61
62        // -----------------------------------------------------------------------
63    //  Setter methods
64    // -----------------------------------------------------------------------
65
66        // -----------------------------------------------------------------------
67    //  Access methods
68    // -----------------------------------------------------------------------
69    inline  void         endDocument();
70
71            void         deactivateContext
72                             (
73                                    SchemaElementDecl* const elem
74                            , const XMLCh*             const content
75                            , ValidationContext*       validationContext = 0
76                            , DatatypeValidator*       actualValidator = 0);
77
78            void         activateIdentityConstraint
79                               (
80                                     SchemaElementDecl* const     elem
81                             ,       int                          elemDepth
82                             , const unsigned int                 uriId
83                             , const XMLCh*                 const elemPrefix
84                             , const RefVectorOf<XMLAttr>&        attrList
85                             , const XMLSize_t                    attrCount
86                             , ValidationContext*                 validationContext = 0 );
87
88            void         reset();
89
90private:
91    // -----------------------------------------------------------------------
92    //  Unimplemented constructors and operators
93    // -----------------------------------------------------------------------
94    IdentityConstraintHandler(const IdentityConstraintHandler& other);
95    IdentityConstraintHandler& operator= (const IdentityConstraintHandler& other);
96
97    // -----------------------------------------------------------------------
98    //  CleanUp methods
99    // -----------------------------------------------------------------------
100    void    cleanUp();
101
102    // -----------------------------------------------------------------------
103    //  Helper
104    // -----------------------------------------------------------------------
105    void    activateSelectorFor(
106                                      IdentityConstraint* const ic
107                              , const int                       initialDepth
108                               ) ;
109
110    // -----------------------------------------------------------------------
111    //  Data members
112    //
113    //  fMatcherStack
114    //      Stack of active XPath matchers for identity constraints. All
115    //      active XPath matchers are notified of startElement, characters
116    //      and endElement callbacks in order to perform their matches.
117    //
118    //  fValueStoreCache
119    //      Cache of value stores for identity constraint fields.
120    //
121    //  fFieldActivator
122    //      Activates fields within a certain scope when a selector matches
123    //      its xpath.
124    //
125    // -----------------------------------------------------------------------
126    XMLScanner*                 fScanner;
127    MemoryManager*              fMemoryManager;
128
129    XPathMatcherStack*          fMatcherStack;
130    ValueStoreCache*            fValueStoreCache;
131    FieldActivator*             fFieldActivator;
132
133};
134
135
136// ---------------------------------------------------------------------------
137//  IdentityConstraintHandler:
138// ---------------------------------------------------------------------------
139
140inline 
141void  IdentityConstraintHandler::endDocument()
142{
143    fValueStoreCache->endDocument();
144}
145
146inline
147XMLSize_t IdentityConstraintHandler::getMatcherCount() const
148{
149    return fMatcherStack->getMatcherCount();
150}
151
152XERCES_CPP_NAMESPACE_END
153
154#endif
155
156/**
157  * End of file IdentityConstraintHandler.hpp
158  */
159
Note: See TracBrowser for help on using the repository browser.