/src/xerces-c/src/xercesc/framework/psvi/XSModelGroupDefinition.cpp
Line | Count | Source |
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: XSModelGroupDefinition.cpp 1804272 2017-08-06 20:25:24Z scantor $ |
20 | | */ |
21 | | |
22 | | #include <xercesc/framework/psvi/XSModelGroupDefinition.hpp> |
23 | | #include <xercesc/framework/psvi/XSParticle.hpp> |
24 | | #include <xercesc/framework/psvi/XSModel.hpp> |
25 | | #include <xercesc/validators/schema/XercesGroupInfo.hpp> |
26 | | |
27 | | |
28 | | XERCES_CPP_NAMESPACE_BEGIN |
29 | | |
30 | | // --------------------------------------------------------------------------- |
31 | | // XSModelGroupDefinition: Constructors and Destructors |
32 | | // --------------------------------------------------------------------------- |
33 | | XSModelGroupDefinition::XSModelGroupDefinition(XercesGroupInfo* const groupInfo, |
34 | | XSParticle* const groupParticle, |
35 | | XSAnnotation* const annot, |
36 | | XSModel* const xsModel, |
37 | | MemoryManager* const manager) |
38 | 0 | : XSObject(XSConstants::MODEL_GROUP_DEFINITION, xsModel, manager) |
39 | 0 | , fGroupInfo(groupInfo) |
40 | 0 | , fModelGroupParticle(groupParticle) |
41 | 0 | , fAnnotation(annot) |
42 | 0 | { |
43 | 0 | } |
44 | | |
45 | | XSModelGroupDefinition::~XSModelGroupDefinition() |
46 | 0 | { |
47 | 0 | if (fModelGroupParticle) // Not owned by XSModel |
48 | 0 | delete fModelGroupParticle; |
49 | 0 | } |
50 | | |
51 | | // --------------------------------------------------------------------------- |
52 | | // XSModelGroupDefinition: XSModel virtual methods |
53 | | // --------------------------------------------------------------------------- |
54 | | const XMLCh *XSModelGroupDefinition::getName() const |
55 | 0 | { |
56 | 0 | return fXSModel->getURIStringPool()->getValueForId(fGroupInfo->getNameId()); |
57 | 0 | } |
58 | | |
59 | | const XMLCh *XSModelGroupDefinition::getNamespace() const |
60 | 0 | { |
61 | 0 | return fXSModel->getURIStringPool()->getValueForId(fGroupInfo->getNamespaceId()); |
62 | 0 | } |
63 | | |
64 | | XSNamespaceItem *XSModelGroupDefinition::getNamespaceItem() |
65 | 0 | { |
66 | 0 | return fXSModel->getNamespaceItem(getNamespace()); |
67 | 0 | } |
68 | | |
69 | | // --------------------------------------------------------------------------- |
70 | | // XSModelGroupDefinition: access methods |
71 | | // --------------------------------------------------------------------------- |
72 | | XSModelGroup* XSModelGroupDefinition::getModelGroup() |
73 | 0 | { |
74 | 0 | if (fModelGroupParticle) |
75 | 0 | return fModelGroupParticle->getModelGroupTerm(); |
76 | | |
77 | 0 | return 0; |
78 | 0 | } |
79 | | |
80 | | |
81 | | XERCES_CPP_NAMESPACE_END |
82 | | |
83 | | |