GME
13
|
00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one or more 00003 * contributor license agreements. See the NOTICE file distributed with 00004 * this work for additional information regarding copyright ownership. 00005 * The ASF licenses this file to You under the Apache License, Version 2.0 00006 * (the "License"); you may not use this file except in compliance with 00007 * the License. You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00018 /* 00019 * $Id: XSModelGroupDefinition.cpp 471747 2006-11-06 14:31:56Z amassari $ 00020 */ 00021 00022 #include <xercesc/framework/psvi/XSModelGroupDefinition.hpp> 00023 #include <xercesc/framework/psvi/XSParticle.hpp> 00024 #include <xercesc/framework/psvi/XSModel.hpp> 00025 #include <xercesc/validators/schema/XercesGroupInfo.hpp> 00026 00027 00028 XERCES_CPP_NAMESPACE_BEGIN 00029 00030 // --------------------------------------------------------------------------- 00031 // XSModelGroupDefinition: Constructors and Destructors 00032 // --------------------------------------------------------------------------- 00033 XSModelGroupDefinition::XSModelGroupDefinition(XercesGroupInfo* const groupInfo, 00034 XSParticle* const groupParticle, 00035 XSAnnotation* const annot, 00036 XSModel* const xsModel, 00037 MemoryManager* const manager) 00038 : XSObject(XSConstants::MODEL_GROUP_DEFINITION, xsModel, manager) 00039 , fGroupInfo(groupInfo) 00040 , fModelGroupParticle(groupParticle) 00041 , fAnnotation(annot) 00042 { 00043 } 00044 00045 XSModelGroupDefinition::~XSModelGroupDefinition() 00046 { 00047 if (fModelGroupParticle) // Not owned by XSModel 00048 delete fModelGroupParticle; 00049 } 00050 00051 // --------------------------------------------------------------------------- 00052 // XSModelGroupDefinition: XSModel virtual methods 00053 // --------------------------------------------------------------------------- 00054 const XMLCh *XSModelGroupDefinition::getName() const 00055 { 00056 return fXSModel->getURIStringPool()->getValueForId(fGroupInfo->getNameId()); 00057 } 00058 00059 const XMLCh *XSModelGroupDefinition::getNamespace() 00060 { 00061 return fXSModel->getURIStringPool()->getValueForId(fGroupInfo->getNamespaceId()); 00062 } 00063 00064 XSNamespaceItem *XSModelGroupDefinition::getNamespaceItem() 00065 { 00066 return fXSModel->getNamespaceItem(getNamespace()); 00067 } 00068 00069 // --------------------------------------------------------------------------- 00070 // XSModelGroupDefinition: access methods 00071 // --------------------------------------------------------------------------- 00072 XSModelGroup* XSModelGroupDefinition::getModelGroup() 00073 { 00074 if (fModelGroupParticle) 00075 return fModelGroupParticle->getModelGroupTerm(); 00076 00077 return 0; 00078 } 00079 00080 00081 XERCES_CPP_NAMESPACE_END 00082 00083