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: IC_Field.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
20 | */ |
---|
21 | |
---|
22 | #if !defined(IC_FIELD_HPP) |
---|
23 | #define IC_FIELD_HPP |
---|
24 | |
---|
25 | |
---|
26 | // --------------------------------------------------------------------------- |
---|
27 | // Includes |
---|
28 | // --------------------------------------------------------------------------- |
---|
29 | #include <xercesc/validators/schema/identity/XPathMatcher.hpp> |
---|
30 | |
---|
31 | #include <xercesc/internal/XSerializable.hpp> |
---|
32 | |
---|
33 | XERCES_CPP_NAMESPACE_BEGIN |
---|
34 | |
---|
35 | // --------------------------------------------------------------------------- |
---|
36 | // Forward Declaration |
---|
37 | // --------------------------------------------------------------------------- |
---|
38 | class ValueStore; |
---|
39 | class FieldActivator; |
---|
40 | |
---|
41 | |
---|
42 | class VALIDATORS_EXPORT IC_Field : public XSerializable, public XMemory |
---|
43 | { |
---|
44 | public: |
---|
45 | // ----------------------------------------------------------------------- |
---|
46 | // Constructors/Destructor |
---|
47 | // ----------------------------------------------------------------------- |
---|
48 | IC_Field(XercesXPath* const xpath, |
---|
49 | IdentityConstraint* const identityConstraint); |
---|
50 | ~IC_Field(); |
---|
51 | |
---|
52 | // ----------------------------------------------------------------------- |
---|
53 | // operators |
---|
54 | // ----------------------------------------------------------------------- |
---|
55 | bool operator== (const IC_Field& other) const; |
---|
56 | bool operator!= (const IC_Field& other) const; |
---|
57 | |
---|
58 | // ----------------------------------------------------------------------- |
---|
59 | // Getter methods |
---|
60 | // ----------------------------------------------------------------------- |
---|
61 | XercesXPath* getXPath() const { return fXPath; } |
---|
62 | IdentityConstraint* getIdentityConstraint() const { return fIdentityConstraint; } |
---|
63 | |
---|
64 | /** |
---|
65 | * @deprecated |
---|
66 | */ |
---|
67 | bool getMayMatch() const { return false; } |
---|
68 | |
---|
69 | // ----------------------------------------------------------------------- |
---|
70 | // Setter methods |
---|
71 | // ----------------------------------------------------------------------- |
---|
72 | /** |
---|
73 | * @deprecated |
---|
74 | */ |
---|
75 | void setMayMatch(const bool) {} |
---|
76 | |
---|
77 | // ----------------------------------------------------------------------- |
---|
78 | // Factory methods |
---|
79 | // ----------------------------------------------------------------------- |
---|
80 | XPathMatcher* createMatcher |
---|
81 | ( |
---|
82 | FieldActivator* const fieldActivator |
---|
83 | , ValueStore* const valueStore |
---|
84 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
---|
85 | ); |
---|
86 | |
---|
87 | /** |
---|
88 | * @deprecated |
---|
89 | */ |
---|
90 | XPathMatcher* createMatcher(ValueStore* const valueStore, |
---|
91 | MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); |
---|
92 | |
---|
93 | /*** |
---|
94 | * Support for Serialization/De-serialization |
---|
95 | ***/ |
---|
96 | DECL_XSERIALIZABLE(IC_Field) |
---|
97 | |
---|
98 | IC_Field(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); |
---|
99 | |
---|
100 | private: |
---|
101 | // ----------------------------------------------------------------------- |
---|
102 | // Unimplemented contstructors and operators |
---|
103 | // ----------------------------------------------------------------------- |
---|
104 | IC_Field(const IC_Field& other); |
---|
105 | IC_Field& operator= (const IC_Field& other); |
---|
106 | |
---|
107 | // ----------------------------------------------------------------------- |
---|
108 | // Data members |
---|
109 | // ----------------------------------------------------------------------- |
---|
110 | XercesXPath* fXPath; |
---|
111 | IdentityConstraint* fIdentityConstraint; |
---|
112 | }; |
---|
113 | |
---|
114 | |
---|
115 | class VALIDATORS_EXPORT FieldMatcher : public XPathMatcher |
---|
116 | { |
---|
117 | public: |
---|
118 | // ----------------------------------------------------------------------- |
---|
119 | // Constructors/Destructor |
---|
120 | // ----------------------------------------------------------------------- |
---|
121 | ~FieldMatcher() {} |
---|
122 | |
---|
123 | // ----------------------------------------------------------------------- |
---|
124 | // Getter methods |
---|
125 | // ----------------------------------------------------------------------- |
---|
126 | ValueStore* getValueStore() const { return fValueStore; } |
---|
127 | IC_Field* getField() const { return fField; } |
---|
128 | |
---|
129 | // ----------------------------------------------------------------------- |
---|
130 | // Virtual methods |
---|
131 | // ----------------------------------------------------------------------- |
---|
132 | void matched(const XMLCh* const content, DatatypeValidator* const dv, |
---|
133 | const bool isNil); |
---|
134 | |
---|
135 | private: |
---|
136 | // ----------------------------------------------------------------------- |
---|
137 | // Constructors/Destructor |
---|
138 | // ----------------------------------------------------------------------- |
---|
139 | FieldMatcher(XercesXPath* const anXPath, |
---|
140 | IC_Field* const aField, |
---|
141 | ValueStore* const valueStore, |
---|
142 | FieldActivator* const fieldActivator, |
---|
143 | MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); |
---|
144 | |
---|
145 | // ----------------------------------------------------------------------- |
---|
146 | // Unimplemented contstructors and operators |
---|
147 | // ----------------------------------------------------------------------- |
---|
148 | FieldMatcher(const FieldMatcher& other); |
---|
149 | FieldMatcher& operator= (const FieldMatcher& other); |
---|
150 | |
---|
151 | // ----------------------------------------------------------------------- |
---|
152 | // Friends |
---|
153 | // ----------------------------------------------------------------------- |
---|
154 | friend class IC_Field; |
---|
155 | |
---|
156 | // ----------------------------------------------------------------------- |
---|
157 | // Data members |
---|
158 | // ----------------------------------------------------------------------- |
---|
159 | ValueStore* fValueStore; |
---|
160 | IC_Field* fField; |
---|
161 | FieldActivator* fFieldActivator; |
---|
162 | }; |
---|
163 | |
---|
164 | XERCES_CPP_NAMESPACE_END |
---|
165 | |
---|
166 | #endif |
---|
167 | |
---|
168 | /** |
---|
169 | * End of file IC_Field.hpp |
---|
170 | */ |
---|
171 | |
---|