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$
20  */
21 
22 #if !defined(XERCESC_INCLUDE_GUARD_XMLSCHEMADESCRIPTIONIMPL_HPP)
23 #define XERCESC_INCLUDE_GUARD_XMLSCHEMADESCRIPTIONIMPL_HPP
24 
25 #include <xercesc/framework/XMLSchemaDescription.hpp>
26 #include <xercesc/util/RefVectorOf.hpp>
27 
28 XERCES_CPP_NAMESPACE_BEGIN
29 
30 class XMLAttDefs;
31 
32 class XMLPARSER_EXPORT XMLSchemaDescriptionImpl : public XMLSchemaDescription
33 {
34 public :
35     // -----------------------------------------------------------------------
36     /** @name constructor and destructor */
37     // -----------------------------------------------------------------------
38     //@{
39     XMLSchemaDescriptionImpl(
40                              const XMLCh* const   targetNamespace
41                            , MemoryManager* const memMgr
42                              );
43 
44     ~XMLSchemaDescriptionImpl();
45     //@}
46 
47     // -----------------------------------------------------------------------
48     /** @name Implementation of GrammarDescription Interface */
49     // -----------------------------------------------------------------------
50     //@{
51     /**
52       * getGrammarKey
53       *
54       */
55     virtual const XMLCh*           getGrammarKey() const;
56     //@}
57 
58     // -----------------------------------------------------------------------
59     /** @name Implementation of SchemaDescription Interface */
60     // -----------------------------------------------------------------------
61     //@{
62 
63     /**
64       * getContextType
65       *
66       */
67     virtual ContextType            getContextType() const;
68 
69     /**
70       * getTargetNamespace
71       *
72       */
73     virtual const XMLCh*           getTargetNamespace() const;
74 
75     /**
76       * getLocationHints
77       *
78       */
79     virtual const RefArrayVectorOf<XMLCh>*   getLocationHints() const;
80 
81     /**
82       * getTriggeringComponent
83       *
84       */
85     virtual const QName*           getTriggeringComponent() const;
86 
87     /**
88       * getenclosingElementName
89       *
90       */
91     virtual const QName*           getEnclosingElementName() const;
92 
93     /**
94       * getAttributes
95       *
96       */
97     virtual const XMLAttDef*       getAttributes() const;
98 
99     /**
100       * setContextType
101       *
102       */
103     virtual void                   setContextType(ContextType);
104 
105     /**
106       * setTargetNamespace
107       *
108       */
109     virtual void                   setTargetNamespace(const XMLCh* const);
110 
111     /**
112       * setLocationHints
113       *
114       */
115     virtual void                   setLocationHints(const XMLCh* const);
116 
117     /**
118       * setTriggeringComponent
119       *
120       */
121     virtual void                   setTriggeringComponent(QName* const);
122 
123     /**
124       * getenclosingElementName
125       *
126       */
127     virtual void                   setEnclosingElementName(QName* const);
128 
129     /**
130       * setAttributes
131       *
132       */
133     virtual void                   setAttributes(XMLAttDef* const);
134     //@}
135 
136     /***
137      * Support for Serialization/De-serialization
138      ***/
139     DECL_XSERIALIZABLE(XMLSchemaDescriptionImpl)
140 
141     XMLSchemaDescriptionImpl(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager);
142 
143 private :
144     // -----------------------------------------------------------------------
145     /** name  Unimplemented copy constructor and operator= */
146     // -----------------------------------------------------------------------
147     //@{
148     XMLSchemaDescriptionImpl(const XMLSchemaDescriptionImpl& );
149     XMLSchemaDescriptionImpl& operator=(const XMLSchemaDescriptionImpl& );
150     //@}
151 
152     // -----------------------------------------------------------------------
153     //  Private data members
154     //
155     //  All data member in this implementation are owned to out survive
156     //  parser. Except for fNamespace which is replicated upon set, the
157     //  rest shall be created by the embedded memoryManager.
158     //
159     //  fContextType
160     //
161     //  fNamespace            owned
162     //
163     //  fLocationHints        owned
164     //
165     //  fTriggeringComponent  owned
166     //
167     //  fEnclosingElementName owned
168     //
169     //  fAttributes           referenced
170     //
171     // -----------------------------------------------------------------------
172 
173     XMLSchemaDescription::ContextType      fContextType;
174     const XMLCh*                           fNamespace;
175     RefArrayVectorOf<XMLCh>*               fLocationHints;
176     const QName*                           fTriggeringComponent;
177     const QName*                           fEnclosingElementName;
178     const XMLAttDef*                       fAttributes;
179 
180 };
181 
182 
183 XERCES_CPP_NAMESPACE_END
184 
185 #endif
186