DOMBuilder.hpp

Go to the documentation of this file.
00001 #ifndef DOMBuilder_HEADER_GUARD_
00002 #define DOMBuilder_HEADER_GUARD_
00003 
00004 /*
00005  * Licensed to the Apache Software Foundation (ASF) under one or more
00006  * contributor license agreements.  See the NOTICE file distributed with
00007  * this work for additional information regarding copyright ownership.
00008  * The ASF licenses this file to You under the Apache License, Version 2.0
00009  * (the "License"); you may not use this file except in compliance with
00010  * the License.  You may obtain a copy of the License at
00011  * 
00012  *      http://www.apache.org/licenses/LICENSE-2.0
00013  * 
00014  * Unless required by applicable law or agreed to in writing, software
00015  * distributed under the License is distributed on an "AS IS" BASIS,
00016  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00017  * See the License for the specific language governing permissions and
00018  * limitations under the License.
00019  */
00020 
00021 /*
00022  * $Id: DOMBuilder.hpp 706743 2008-10-21 20:05:27Z borisk $
00023  *
00024  */
00025 
00026 
00027 #include <xercesc/util/XercesDefs.hpp>
00028 
00029 XERCES_CPP_NAMESPACE_BEGIN
00030 
00031 
00032 class DOMErrorHandler;
00033 class DOMEntityResolver;
00034 class DOMInputSource;
00035 class DOMBuilderFilter;
00036 class DOMNode;
00037 class DOMDocument;
00038 class Grammar;
00039 
00050 class CDOM_EXPORT DOMBuilder
00051 {
00052 protected :
00053     // -----------------------------------------------------------------------
00054     //  Hidden constructors
00055     // -----------------------------------------------------------------------
00058     DOMBuilder() {};
00060 
00061 private:    
00062     // -----------------------------------------------------------------------
00063     // Unimplemented constructors and operators
00064     // -----------------------------------------------------------------------
00067     DOMBuilder(const DOMBuilder &);
00068     DOMBuilder & operator = (const DOMBuilder &);
00070 
00071 public:
00072     // -----------------------------------------------------------------------
00073     //  All constructors are hidden, just the destructor is available
00074     // -----------------------------------------------------------------------
00081     virtual ~DOMBuilder() {};
00083 
00084     // -----------------------------------------------------------------------
00085     //  Class types
00086     // -----------------------------------------------------------------------
00116     enum ActionType
00117     {
00118         ACTION_REPLACE            = 1,
00119         ACTION_APPEND_AS_CHILDREN = 2,
00120         ACTION_INSERT_AFTER       = 3,
00121         ACTION_INSERT_BEFORE      = 4
00122     };
00124 
00125     // -----------------------------------------------------------------------
00126     //  Virtual DOMBuilder interface
00127     // -----------------------------------------------------------------------
00130 
00131     // -----------------------------------------------------------------------
00132     //  Getter methods
00133     // -----------------------------------------------------------------------
00134 
00146     virtual DOMErrorHandler* getErrorHandler() = 0;
00147 
00159     virtual const DOMErrorHandler* getErrorHandler() const = 0;
00160 
00172     virtual DOMEntityResolver* getEntityResolver() = 0;
00173 
00185     virtual const DOMEntityResolver* getEntityResolver() const = 0;
00186 
00198     virtual DOMBuilderFilter* getFilter() = 0;
00199 
00211     virtual const DOMBuilderFilter* getFilter() const = 0;
00212 
00213     // -----------------------------------------------------------------------
00214     //  Setter methods
00215     // -----------------------------------------------------------------------
00233     virtual void setErrorHandler(DOMErrorHandler* const handler) = 0;
00234 
00254     virtual void setEntityResolver(DOMEntityResolver* const handler) = 0;
00255 
00277     virtual void setFilter(DOMBuilderFilter* const filter) = 0;
00278 
00279     // -----------------------------------------------------------------------
00280     //  Feature methods
00281     // -----------------------------------------------------------------------
00305     virtual void setFeature(const XMLCh* const name, const bool state) = 0;
00306 
00322     virtual bool getFeature(const XMLCh* const name) const = 0;
00323 
00340     virtual bool canSetFeature(const XMLCh* const name, const bool state) const = 0;
00341 
00342     // -----------------------------------------------------------------------
00343     //  Parsing methods
00344     // -----------------------------------------------------------------------
00375     virtual DOMDocument* parse(const DOMInputSource& source) = 0;
00376 
00404     virtual DOMDocument* parseURI(const XMLCh* const systemId) = 0;
00405 
00432     virtual DOMDocument* parseURI(const char* const systemId) = 0;
00433 
00462     virtual void parseWithContext
00463     (
00464         const   DOMInputSource& source
00465         ,       DOMNode* const contextNode
00466         , const short action
00467     ) = 0;
00469 
00470     // -----------------------------------------------------------------------
00471     //  Non-standard Extension
00472     // -----------------------------------------------------------------------
00475 
00497     virtual void* getProperty(const XMLCh* const name) const = 0 ;
00498 
00520     virtual void setProperty(const XMLCh* const name, void* value) = 0 ;
00521 
00528     virtual void              release() = 0;
00529 
00553     virtual void              resetDocumentPool() = 0;
00554 
00582     virtual Grammar* loadGrammar(const DOMInputSource& source,
00583                                  const short grammarType,
00584                                  const bool toCache = false) = 0;
00585 
00611     virtual Grammar* loadGrammar(const XMLCh* const systemId,
00612                                  const short grammarType,
00613                                  const bool toCache = false) = 0;
00614 
00640     virtual Grammar* loadGrammar(const char* const systemId,
00641                                  const short grammarType,
00642                                  const bool toCache = false) = 0;
00643 
00650     virtual Grammar* getGrammar(const XMLCh* const nameSpaceKey) const = 0;
00651 
00657     virtual Grammar* getRootGrammar() const = 0;
00658 
00665     virtual const XMLCh* getURIText(unsigned int uriId) const = 0;
00666 
00670     virtual void resetCachedGrammarPool() = 0;
00671 
00677     virtual unsigned int getSrcOffset() const = 0;
00678 
00680 
00681 };
00682 
00683 
00684 XERCES_CPP_NAMESPACE_END
00685 
00686 #endif

Generated on Thu Feb 19 11:35:43 2009 for Xerces-C++ by  doxygen 1.5.4