00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 #if !defined(XSANNOTATION_HPP)
00022 #define XSANNOTATION_HPP
00023 
00024 #include <xercesc/framework/psvi/XSObject.hpp>
00025 #include <xercesc/internal/XSerializable.hpp>
00026 
00027 XERCES_CPP_NAMESPACE_BEGIN
00028 
00036 
00037 class DOMNode;
00038 class ContentHandler;
00039 
00040 class  XSAnnotation : public XSerializable, public XSObject
00041 {
00042 public:
00043 
00044     
00045     enum ANNOTATION_TARGET {
00049         W3C_DOM_ELEMENT           = 1,
00053         W3C_DOM_DOCUMENT          = 2
00054     };
00055 
00056     
00057     
00060 
00067     XSAnnotation
00068     (
00069         const XMLCh* const contents
00070         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00071     );
00072 
00074 
00077     ~XSAnnotation();
00079 
00080     
00084 
00095     void writeAnnotation(DOMNode* node, ANNOTATION_TARGET targetType);  
00096 
00104     void writeAnnotation(ContentHandler* handler);
00105 
00109     const XMLCh *getAnnotationString() const;
00110     XMLCh *getAnnotationString();
00111 
00113 
00114     
00117     void            setNext(XSAnnotation* const nextAnnotation);
00118     XSAnnotation*   getNext();
00120 
00121     
00124     inline void           getLineCol(int& line, int& col)  const;
00125     inline const XMLCh*   getSystemId()                    const;    
00127 
00128     
00131     inline void           setLineCol(int line, int col);
00132            void           setSystemId(const XMLCh* const systemId);    
00134 
00135     
00136 
00137 
00138     DECL_XSERIALIZABLE(XSAnnotation)
00139     XSAnnotation(MemoryManager* const manager);
00140 
00141 private:
00142 
00143     
00144     
00145     
00146     XSAnnotation(const XSAnnotation&);
00147     XSAnnotation & operator=(const XSAnnotation &);
00148 
00149 protected:
00150 
00151     
00152     
00153     
00154     XMLCh*        fContents;
00155     XSAnnotation* fNext;
00156 
00157 private:
00158 
00159     XMLCh*        fSystemId;
00160     int           fLine;
00161     int           fCol;
00162 
00163 };
00164 
00165 inline const XMLCh *XSAnnotation::getAnnotationString() const
00166 {
00167     return fContents;
00168 }
00169 
00170 inline XMLCh *XSAnnotation::getAnnotationString()
00171 {
00172     return fContents;
00173 }
00174 
00175 inline void XSAnnotation::getLineCol(int& line, int& col) const
00176 {
00177     line = fLine;
00178     col  = fCol;
00179 }
00180 
00181 inline const XMLCh* XSAnnotation::getSystemId() const
00182 {
00183     return fSystemId;
00184 }
00185 
00186 inline void XSAnnotation::setLineCol(int line, int col)
00187 {
00188     fLine = line;
00189     fCol  = col;
00190 }
00191 
00192 XERCES_CPP_NAMESPACE_END
00193 
00194 #endif