1 | /*
|
---|
2 | * Copyright 2003,2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*
|
---|
18 | * $Log: XSFacet.hpp,v $
|
---|
19 | * Revision 1.7 2004/09/08 13:56:08 peiyongz
|
---|
20 | * Apache License Version 2.0
|
---|
21 | *
|
---|
22 | * Revision 1.6 2003/12/01 23:23:26 neilg
|
---|
23 | * fix for bug 25118; thanks to Jeroen Witmond
|
---|
24 | *
|
---|
25 | * Revision 1.5 2003/11/21 17:29:53 knoaman
|
---|
26 | * PSVI update
|
---|
27 | *
|
---|
28 | * Revision 1.4 2003/11/14 22:47:53 neilg
|
---|
29 | * fix bogus log message from previous commit...
|
---|
30 | *
|
---|
31 | * Revision 1.3 2003/11/14 22:33:30 neilg
|
---|
32 | * Second phase of schema component model implementation.
|
---|
33 | * Implement XSModel, XSNamespaceItem, and the plumbing necessary
|
---|
34 | * to connect them to the other components.
|
---|
35 | * Thanks to David Cargill.
|
---|
36 | *
|
---|
37 | * Revision 1.2 2003/11/06 15:30:04 neilg
|
---|
38 | * first part of PSVI/schema component model implementation, thanks to David Cargill. This covers setting the PSVIHandler on parser objects, as well as implementing XSNotation, XSSimpleTypeDefinition, XSIDCDefinition, and most of XSWildcard, XSComplexTypeDefinition, XSElementDeclaration, XSAttributeDeclaration and XSAttributeUse.
|
---|
39 | *
|
---|
40 | * Revision 1.1 2003/09/16 14:33:36 neilg
|
---|
41 | * PSVI/schema component model classes, with Makefile/configuration changes necessary to build them
|
---|
42 | *
|
---|
43 | */
|
---|
44 |
|
---|
45 | #if !defined(XSFACET_HPP)
|
---|
46 | #define XSFACET_HPP
|
---|
47 |
|
---|
48 | #include <xercesc/framework/psvi/XSSimpleTypeDefinition.hpp>
|
---|
49 |
|
---|
50 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
51 |
|
---|
52 | /**
|
---|
53 | * This represents all Schema Facet components with the exception
|
---|
54 | * of Enumeration and Pattern Facets, which are represented by the
|
---|
55 | * XSMultiValueFacet interface.
|
---|
56 | * This is *always* owned by the validator /parser object from which
|
---|
57 | * it is obtained.
|
---|
58 | */
|
---|
59 |
|
---|
60 | // forward declarations
|
---|
61 | class XSAnnotation;
|
---|
62 |
|
---|
63 | class XMLPARSER_EXPORT XSFacet : public XSObject
|
---|
64 | {
|
---|
65 | public:
|
---|
66 |
|
---|
67 | // Constructors and Destructor
|
---|
68 | // -----------------------------------------------------------------------
|
---|
69 | /** @name Constructors */
|
---|
70 | //@{
|
---|
71 |
|
---|
72 | /**
|
---|
73 | * The default constructor
|
---|
74 | *
|
---|
75 | * @param facetKind
|
---|
76 | * @param lexicalValue
|
---|
77 | * @param isFixed
|
---|
78 | * @param annot
|
---|
79 | * @param xsModel
|
---|
80 | * @param manager The configurable memory manager
|
---|
81 | */
|
---|
82 | XSFacet
|
---|
83 | (
|
---|
84 | XSSimpleTypeDefinition::FACET facetKind
|
---|
85 | , const XMLCh* const lexicalValue
|
---|
86 | , bool isFixed
|
---|
87 | , XSAnnotation* const annot
|
---|
88 | , XSModel* const xsModel
|
---|
89 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
90 | );
|
---|
91 |
|
---|
92 | //@};
|
---|
93 |
|
---|
94 | /** @name Destructor */
|
---|
95 | //@{
|
---|
96 | ~XSFacet();
|
---|
97 | //@}
|
---|
98 |
|
---|
99 | //---------------------
|
---|
100 | /** @name XSFacet methods */
|
---|
101 |
|
---|
102 | //@{
|
---|
103 |
|
---|
104 | /**
|
---|
105 | * @return An indication as to the facet's type; see <code>XSSimpleTypeDefinition::FACET</code>
|
---|
106 | */
|
---|
107 | XSSimpleTypeDefinition::FACET getFacetKind() const;
|
---|
108 |
|
---|
109 | /**
|
---|
110 | * @return Returns a value of a constraining facet.
|
---|
111 | */
|
---|
112 | const XMLCh *getLexicalFacetValue() const;
|
---|
113 |
|
---|
114 | /**
|
---|
115 | * Check whether a facet value is fixed.
|
---|
116 | */
|
---|
117 | bool isFixed() const;
|
---|
118 |
|
---|
119 | /**
|
---|
120 | * @return an annotation
|
---|
121 | */
|
---|
122 | XSAnnotation *getAnnotation() const;
|
---|
123 |
|
---|
124 | //@}
|
---|
125 |
|
---|
126 | //----------------------------------
|
---|
127 | /** methods needed by implementation */
|
---|
128 |
|
---|
129 | //@{
|
---|
130 |
|
---|
131 | //@}
|
---|
132 | private:
|
---|
133 |
|
---|
134 | // -----------------------------------------------------------------------
|
---|
135 | // Unimplemented constructors and operators
|
---|
136 | // -----------------------------------------------------------------------
|
---|
137 | XSFacet(const XSFacet&);
|
---|
138 | XSFacet & operator=(const XSFacet &);
|
---|
139 |
|
---|
140 | protected:
|
---|
141 |
|
---|
142 | // -----------------------------------------------------------------------
|
---|
143 | // data members
|
---|
144 | // -----------------------------------------------------------------------
|
---|
145 | XSSimpleTypeDefinition::FACET fFacetKind;
|
---|
146 | bool fIsFixed;
|
---|
147 | const XMLCh* fLexicalValue;
|
---|
148 | XSAnnotation* fAnnotation;
|
---|
149 | };
|
---|
150 |
|
---|
151 | inline XSSimpleTypeDefinition::FACET XSFacet::getFacetKind() const
|
---|
152 | {
|
---|
153 | return fFacetKind;
|
---|
154 | }
|
---|
155 |
|
---|
156 | inline const XMLCh* XSFacet::getLexicalFacetValue() const
|
---|
157 | {
|
---|
158 | return fLexicalValue;
|
---|
159 | }
|
---|
160 |
|
---|
161 | inline bool XSFacet::isFixed() const
|
---|
162 | {
|
---|
163 | return fIsFixed;
|
---|
164 | }
|
---|
165 |
|
---|
166 | inline XSAnnotation* XSFacet::getAnnotation() const
|
---|
167 | {
|
---|
168 | return fAnnotation;
|
---|
169 | }
|
---|
170 |
|
---|
171 |
|
---|
172 | XERCES_CPP_NAMESPACE_END
|
---|
173 |
|
---|
174 | #endif
|
---|