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