|
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: IDREFDatatypeValidator.hpp 568078 2007-08-21 11:43:25Z amassari $ |
|
36 */ |
|
37 |
|
38 #if !defined(IDREF_DATATYPEVALIDATOR_HPP) |
|
39 #define IDREF_DATATYPEVALIDATOR_HPP |
|
40 |
|
41 #include <xercesc/validators/datatype/StringDatatypeValidator.hpp> |
|
42 #include <xercesc/framework/XMLRefInfo.hpp> |
|
43 |
|
44 XERCES_CPP_NAMESPACE_BEGIN |
|
45 |
|
46 class VALIDATORS_EXPORT IDREFDatatypeValidator : public StringDatatypeValidator |
|
47 { |
|
48 public: |
|
49 |
|
50 // ----------------------------------------------------------------------- |
|
51 // Public ctor/dtor |
|
52 // ----------------------------------------------------------------------- |
|
53 /** @name Constructors and Destructor */ |
|
54 //@{ |
|
55 |
|
56 IDREFDatatypeValidator |
|
57 ( |
|
58 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
|
59 ); |
|
60 IDREFDatatypeValidator |
|
61 ( |
|
62 DatatypeValidator* const baseValidator |
|
63 , RefHashTableOf<KVStringPair>* const facets |
|
64 , RefArrayVectorOf<XMLCh>* const enums |
|
65 , const int finalSet |
|
66 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
|
67 ); |
|
68 |
|
69 virtual ~IDREFDatatypeValidator(); |
|
70 |
|
71 //@} |
|
72 |
|
73 // ----------------------------------------------------------------------- |
|
74 // Validation methods |
|
75 // ----------------------------------------------------------------------- |
|
76 /** @name Validation Function */ |
|
77 //@{ |
|
78 |
|
79 /** |
|
80 * validate that a string matches the boolean datatype |
|
81 * @param content A string containing the content to be validated |
|
82 * |
|
83 * @exception throws InvalidDatatypeException if the content is |
|
84 * is not valid. |
|
85 */ |
|
86 |
|
87 virtual void validate |
|
88 ( |
|
89 const XMLCh* const content |
|
90 , ValidationContext* const context = 0 |
|
91 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
|
92 ); |
|
93 |
|
94 //@} |
|
95 |
|
96 /** |
|
97 * Returns an instance of the base datatype validator class |
|
98 * Used by the DatatypeValidatorFactory. |
|
99 */ |
|
100 virtual DatatypeValidator* newInstance |
|
101 ( |
|
102 RefHashTableOf<KVStringPair>* const facets |
|
103 , RefArrayVectorOf<XMLCh>* const enums |
|
104 , const int finalSet |
|
105 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
|
106 ); |
|
107 |
|
108 //deprecated |
|
109 inline void setIDRefList(RefHashTableOf<XMLRefInfo>* fIDRefList); |
|
110 |
|
111 /*** |
|
112 * Support for Serialization/De-serialization |
|
113 ***/ |
|
114 DECL_XSERIALIZABLE(IDREFDatatypeValidator) |
|
115 |
|
116 protected: |
|
117 |
|
118 // |
|
119 // ctor provided to be used by derived classes |
|
120 // |
|
121 IDREFDatatypeValidator |
|
122 ( |
|
123 DatatypeValidator* const baseValidator |
|
124 , RefHashTableOf<KVStringPair>* const facets |
|
125 , const int finalSet |
|
126 , const ValidatorType type |
|
127 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
|
128 ); |
|
129 |
|
130 virtual void checkValueSpace(const XMLCh* const content |
|
131 , MemoryManager* const manager); |
|
132 |
|
133 private: |
|
134 // ----------------------------------------------------------------------- |
|
135 // Unimplemented constructors and operators |
|
136 // ----------------------------------------------------------------------- |
|
137 IDREFDatatypeValidator(const IDREFDatatypeValidator&); |
|
138 IDREFDatatypeValidator& operator=(const IDREFDatatypeValidator&); |
|
139 |
|
140 // ----------------------------------------------------------------------- |
|
141 // Private data members |
|
142 // |
|
143 // |
|
144 // ----------------------------------------------------------------------- |
|
145 |
|
146 }; |
|
147 |
|
148 // ----------------------------------------------------------------------- |
|
149 // Validation methods |
|
150 // ----------------------------------------------------------------------- |
|
151 inline void IDREFDatatypeValidator::setIDRefList(RefHashTableOf<XMLRefInfo>* ) |
|
152 { |
|
153 } |
|
154 |
|
155 XERCES_CPP_NAMESPACE_END |
|
156 |
|
157 #endif |
|
158 |
|
159 /** |
|
160 * End of file IDREFDatatypeValidator.hpp |
|
161 */ |