|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 /* |
|
18 * Licensed to the Apache Software Foundation (ASF) under one or more |
|
19 * contributor license agreements. See the NOTICE file distributed with |
|
20 * this work for additional information regarding copyright ownership. |
|
21 * The ASF licenses this file to You under the Apache License, Version 2.0 |
|
22 * (the "License"); you may not use this file except in compliance with |
|
23 * the License. You may obtain a copy of the License at |
|
24 * |
|
25 * http://www.apache.org/licenses/LICENSE-2.0 |
|
26 * |
|
27 * Unless required by applicable law or agreed to in writing, software |
|
28 * distributed under the License is distributed on an "AS IS" BASIS, |
|
29 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
30 * See the License for the specific language governing permissions and |
|
31 * limitations under the License. |
|
32 */ |
|
33 |
|
34 /* |
|
35 * $Id: IC_Field.hpp 568078 2007-08-21 11:43:25Z amassari $ |
|
36 */ |
|
37 |
|
38 #if !defined(IC_FIELD_HPP) |
|
39 #define IC_FIELD_HPP |
|
40 |
|
41 |
|
42 // --------------------------------------------------------------------------- |
|
43 // Includes |
|
44 // --------------------------------------------------------------------------- |
|
45 #include <xercesc/validators/schema/identity/XPathMatcher.hpp> |
|
46 |
|
47 #include <xercesc/internal/XSerializable.hpp> |
|
48 |
|
49 XERCES_CPP_NAMESPACE_BEGIN |
|
50 |
|
51 // --------------------------------------------------------------------------- |
|
52 // Forward Declaration |
|
53 // --------------------------------------------------------------------------- |
|
54 class ValueStore; |
|
55 class FieldActivator; |
|
56 |
|
57 |
|
58 class VALIDATORS_EXPORT IC_Field : public XSerializable, public XMemory |
|
59 { |
|
60 public: |
|
61 // ----------------------------------------------------------------------- |
|
62 // Constructors/Destructor |
|
63 // ----------------------------------------------------------------------- |
|
64 IC_Field(XercesXPath* const xpath, |
|
65 IdentityConstraint* const identityConstraint); |
|
66 ~IC_Field(); |
|
67 |
|
68 // ----------------------------------------------------------------------- |
|
69 // operators |
|
70 // ----------------------------------------------------------------------- |
|
71 bool operator== (const IC_Field& other) const; |
|
72 bool operator!= (const IC_Field& other) const; |
|
73 |
|
74 // ----------------------------------------------------------------------- |
|
75 // Getter methods |
|
76 // ----------------------------------------------------------------------- |
|
77 XercesXPath* getXPath() const { return fXPath; } |
|
78 IdentityConstraint* getIdentityConstraint() const { return fIdentityConstraint; } |
|
79 |
|
80 /** |
|
81 * @deprecated |
|
82 */ |
|
83 bool getMayMatch() const { return false; } |
|
84 |
|
85 // ----------------------------------------------------------------------- |
|
86 // Setter methods |
|
87 // ----------------------------------------------------------------------- |
|
88 /** |
|
89 * @deprecated |
|
90 */ |
|
91 void setMayMatch(const bool) {} |
|
92 |
|
93 // ----------------------------------------------------------------------- |
|
94 // Factory methods |
|
95 // ----------------------------------------------------------------------- |
|
96 XPathMatcher* createMatcher |
|
97 ( |
|
98 FieldActivator* const fieldActivator |
|
99 , ValueStore* const valueStore |
|
100 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
|
101 ); |
|
102 |
|
103 /** |
|
104 * @deprecated |
|
105 */ |
|
106 XPathMatcher* createMatcher(ValueStore* const valueStore, |
|
107 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); |
|
108 |
|
109 /*** |
|
110 * Support for Serialization/De-serialization |
|
111 ***/ |
|
112 DECL_XSERIALIZABLE(IC_Field) |
|
113 |
|
114 IC_Field(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); |
|
115 |
|
116 private: |
|
117 // ----------------------------------------------------------------------- |
|
118 // Unimplemented contstructors and operators |
|
119 // ----------------------------------------------------------------------- |
|
120 IC_Field(const IC_Field& other); |
|
121 IC_Field& operator= (const IC_Field& other); |
|
122 |
|
123 // ----------------------------------------------------------------------- |
|
124 // Data members |
|
125 // ----------------------------------------------------------------------- |
|
126 XercesXPath* fXPath; |
|
127 IdentityConstraint* fIdentityConstraint; |
|
128 }; |
|
129 |
|
130 |
|
131 class VALIDATORS_EXPORT FieldMatcher : public XPathMatcher |
|
132 { |
|
133 public: |
|
134 // ----------------------------------------------------------------------- |
|
135 // Constructors/Destructor |
|
136 // ----------------------------------------------------------------------- |
|
137 ~FieldMatcher() {} |
|
138 |
|
139 // ----------------------------------------------------------------------- |
|
140 // Getter methods |
|
141 // ----------------------------------------------------------------------- |
|
142 ValueStore* getValueStore() const { return fValueStore; } |
|
143 IC_Field* getField() const { return fField; } |
|
144 |
|
145 // ----------------------------------------------------------------------- |
|
146 // Virtual methods |
|
147 // ----------------------------------------------------------------------- |
|
148 void matched(const XMLCh* const content, DatatypeValidator* const dv, |
|
149 const bool isNil); |
|
150 |
|
151 private: |
|
152 // ----------------------------------------------------------------------- |
|
153 // Constructors/Destructor |
|
154 // ----------------------------------------------------------------------- |
|
155 FieldMatcher(XercesXPath* const anXPath, |
|
156 IC_Field* const aField, |
|
157 ValueStore* const valueStore, |
|
158 FieldActivator* const fieldActivator, |
|
159 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); |
|
160 |
|
161 // ----------------------------------------------------------------------- |
|
162 // Unimplemented contstructors and operators |
|
163 // ----------------------------------------------------------------------- |
|
164 FieldMatcher(const FieldMatcher& other); |
|
165 FieldMatcher& operator= (const FieldMatcher& other); |
|
166 |
|
167 // ----------------------------------------------------------------------- |
|
168 // Friends |
|
169 // ----------------------------------------------------------------------- |
|
170 friend class IC_Field; |
|
171 |
|
172 // ----------------------------------------------------------------------- |
|
173 // Data members |
|
174 // ----------------------------------------------------------------------- |
|
175 ValueStore* fValueStore; |
|
176 IC_Field* fField; |
|
177 FieldActivator* fFieldActivator; |
|
178 }; |
|
179 |
|
180 XERCES_CPP_NAMESPACE_END |
|
181 |
|
182 #endif |
|
183 |
|
184 /** |
|
185 * End of file IC_Field.hpp |
|
186 */ |
|
187 |