|
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: XSFacet.hpp 568078 2007-08-21 11:43:25Z amassari $ |
|
36 */ |
|
37 |
|
38 #if !defined(XSFACET_HPP) |
|
39 #define XSFACET_HPP |
|
40 |
|
41 #include <xercesc/framework/psvi/XSSimpleTypeDefinition.hpp> |
|
42 |
|
43 XERCES_CPP_NAMESPACE_BEGIN |
|
44 |
|
45 /** |
|
46 * This represents all Schema Facet components with the exception |
|
47 * of Enumeration and Pattern Facets, which are represented by the |
|
48 * XSMultiValueFacet interface. |
|
49 * This is *always* owned by the validator /parser object from which |
|
50 * it is obtained. |
|
51 */ |
|
52 |
|
53 // forward declarations |
|
54 class XSAnnotation; |
|
55 |
|
56 class XMLPARSER_EXPORT XSFacet : public XSObject |
|
57 { |
|
58 public: |
|
59 |
|
60 // Constructors and Destructor |
|
61 // ----------------------------------------------------------------------- |
|
62 /** @name Constructors */ |
|
63 //@{ |
|
64 |
|
65 /** |
|
66 * The default constructor |
|
67 * |
|
68 * @param facetKind |
|
69 * @param lexicalValue |
|
70 * @param isFixed |
|
71 * @param annot |
|
72 * @param xsModel |
|
73 * @param manager The configurable memory manager |
|
74 */ |
|
75 XSFacet |
|
76 ( |
|
77 XSSimpleTypeDefinition::FACET facetKind |
|
78 , const XMLCh* const lexicalValue |
|
79 , bool isFixed |
|
80 , XSAnnotation* const annot |
|
81 , XSModel* const xsModel |
|
82 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager |
|
83 ); |
|
84 |
|
85 //@}; |
|
86 |
|
87 /** @name Destructor */ |
|
88 //@{ |
|
89 ~XSFacet(); |
|
90 //@} |
|
91 |
|
92 //--------------------- |
|
93 /** @name XSFacet methods */ |
|
94 |
|
95 //@{ |
|
96 |
|
97 /** |
|
98 * @return An indication as to the facet's type; see <code>XSSimpleTypeDefinition::FACET</code> |
|
99 */ |
|
100 XSSimpleTypeDefinition::FACET getFacetKind() const; |
|
101 |
|
102 /** |
|
103 * @return Returns a value of a constraining facet. |
|
104 */ |
|
105 const XMLCh *getLexicalFacetValue() const; |
|
106 |
|
107 /** |
|
108 * Check whether a facet value is fixed. |
|
109 */ |
|
110 bool isFixed() const; |
|
111 |
|
112 /** |
|
113 * @return an annotation |
|
114 */ |
|
115 XSAnnotation *getAnnotation() const; |
|
116 |
|
117 //@} |
|
118 |
|
119 //---------------------------------- |
|
120 /** methods needed by implementation */ |
|
121 |
|
122 //@{ |
|
123 |
|
124 //@} |
|
125 private: |
|
126 |
|
127 // ----------------------------------------------------------------------- |
|
128 // Unimplemented constructors and operators |
|
129 // ----------------------------------------------------------------------- |
|
130 XSFacet(const XSFacet&); |
|
131 XSFacet & operator=(const XSFacet &); |
|
132 |
|
133 protected: |
|
134 |
|
135 // ----------------------------------------------------------------------- |
|
136 // data members |
|
137 // ----------------------------------------------------------------------- |
|
138 XSSimpleTypeDefinition::FACET fFacetKind; |
|
139 bool fIsFixed; |
|
140 const XMLCh* fLexicalValue; |
|
141 XSAnnotation* fAnnotation; |
|
142 }; |
|
143 |
|
144 inline XSSimpleTypeDefinition::FACET XSFacet::getFacetKind() const |
|
145 { |
|
146 return fFacetKind; |
|
147 } |
|
148 |
|
149 inline const XMLCh* XSFacet::getLexicalFacetValue() const |
|
150 { |
|
151 return fLexicalValue; |
|
152 } |
|
153 |
|
154 inline bool XSFacet::isFixed() const |
|
155 { |
|
156 return fIsFixed; |
|
157 } |
|
158 |
|
159 inline XSAnnotation* XSFacet::getAnnotation() const |
|
160 { |
|
161 return fAnnotation; |
|
162 } |
|
163 |
|
164 |
|
165 XERCES_CPP_NAMESPACE_END |
|
166 |
|
167 #endif |