GME  13
XMLInitializer.cpp
Go to the documentation of this file.
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: XMLInitializer.cpp 635560 2008-03-10 14:10:09Z borisk $
00020  */
00021 
00022 
00023 // ---------------------------------------------------------------------------
00024 //  Includes
00025 // ---------------------------------------------------------------------------
00026 #include <xercesc/util/XMLInitializer.hpp>
00027 #include <xercesc/util/PlatformUtils.hpp>
00028 
00029 XERCES_CPP_NAMESPACE_BEGIN
00030 
00031 // ---------------------------------------------------------------------------
00032 //  XMLInitializer: Initialization methods
00033 // ---------------------------------------------------------------------------
00034 void XMLInitializer::initializeStaticData()
00035 {
00036     try
00037     {
00038         // Note that in some cases the order of initialization can be
00039         // important.
00040         //
00041 
00042         // Core
00043         //
00044         initializeEncodingValidator();
00045         initializeXMLException();
00046         initializeXMLScanner();
00047         initializeXMLValidator();
00048 
00049         // Regex
00050         //
00051         initializeRangeTokenMap();
00052         initializeRegularExpression();
00053 
00054         // DTD
00055         //
00056         initializeDTDGrammar();
00057 
00058         // Schema
00059         //
00060         initializeXSDErrorReporter();
00061         initializeDatatypeValidatorFactory();
00062         initializeGeneralAttributeCheck();
00063         initializeXSValue();
00064         initializeComplexTypeInfo();
00065 
00066         // DOM
00067         //
00068         initializeDOMImplementationRegistry();
00069         initializeDOMImplementationImpl();
00070         initializeDOMDocumentTypeImpl();
00071         initializeDOMNodeListImpl();
00072         initializeDOMNormalizer();
00073     }
00074     catch(...) {
00075         XMLPlatformUtils::panic(PanicHandler::Panic_AllStaticInitErr);
00076     }
00077 }
00078 
00079 
00080 void XMLInitializer::terminateStaticData()
00081 {
00082     // Terminate in the reverse order of initialization. There shouldn't
00083     // be any exceptions and if there are, we can't do anything about them
00084     // since we are no longer initialized (think of it as throwing from
00085     // a destructor).
00086     //
00087 
00088     // DOM
00089     //
00090     terminateDOMNormalizer();
00091     terminateDOMNodeListImpl();
00092     terminateDOMDocumentTypeImpl();
00093     terminateDOMImplementationImpl();
00094     terminateDOMImplementationRegistry();
00095 
00096     // Schema
00097     //
00098     terminateComplexTypeInfo();
00099     terminateXSValue();
00100     terminateGeneralAttributeCheck();
00101     terminateDatatypeValidatorFactory();
00102     terminateXSDErrorReporter();
00103 
00104     // DTD
00105     //
00106     terminateDTDGrammar();
00107 
00108     // Regex
00109     //
00110     terminateRegularExpression();
00111     terminateRangeTokenMap();
00112 
00113     // Core
00114     //
00115     terminateXMLValidator();
00116     terminateXMLScanner();
00117     terminateXMLException();
00118     terminateEncodingValidator();
00119 }
00120 
00121 
00122 XERCES_CPP_NAMESPACE_END