XSAnnotation.hpp
Go to the documentation of this file.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id$
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSANNOTATION_HPP)
#define XERCESC_INCLUDE_GUARD_XSANNOTATION_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
#include <xercesc/internal/XSerializable.hpp>
XERCES_CPP_NAMESPACE_BEGIN
// forward declarations
class DOMNode;
class ContentHandler;
class XMLPARSER_EXPORT XSAnnotation : public XSerializable, public XSObject
{
public:
// TargetType
enum ANNOTATION_TARGET {
W3C_DOM_ELEMENT = 1,
W3C_DOM_DOCUMENT = 2
};
// Constructors and Destructor
// -----------------------------------------------------------------------
XSAnnotation
(
const XMLCh* const contents
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
~XSAnnotation();
//---------------------
void writeAnnotation(DOMNode* node, ANNOTATION_TARGET targetType);
void writeAnnotation(ContentHandler* handler);
const XMLCh *getAnnotationString() const;
XMLCh *getAnnotationString();
//----------------------------------
void setNext(XSAnnotation* const nextAnnotation);
XSAnnotation* getNext();
//-----------------------------
inline void getLineCol(XMLFileLoc& line, XMLFileLoc& col) const;
inline const XMLCh* getSystemId() const;
//-----------------------------
inline void setLineCol(XMLFileLoc line, XMLFileLoc col);
void setSystemId(const XMLCh* const systemId);
/***
* Support for Serialization/De-serialization
***/
DECL_XSERIALIZABLE(XSAnnotation)
XSAnnotation(MemoryManager* const manager);
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSAnnotation(const XSAnnotation&);
XSAnnotation & operator=(const XSAnnotation &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
XMLCh* fContents;
XSAnnotation* fNext;
private:
XMLCh* fSystemId;
XMLFileLoc fLine;
XMLFileLoc fCol;
};
inline const XMLCh *XSAnnotation::getAnnotationString() const
{
return fContents;
}
inline XMLCh *XSAnnotation::getAnnotationString()
{
return fContents;
}
inline void XSAnnotation::getLineCol(XMLFileLoc& line, XMLFileLoc& col) const
{
line = fLine;
col = fCol;
}
inline const XMLCh* XSAnnotation::getSystemId() const
{
return fSystemId;
}
inline void XSAnnotation::setLineCol(XMLFileLoc line, XMLFileLoc col)
{
fLine = line;
fCol = col;
}
XERCES_CPP_NAMESPACE_END
#endif
XSObject.hpp
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition XercesDefs.hpp:163
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
XMLCh
char16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
XMLFileLoc
XMLUInt64 XMLFileLoc
Definition Xerces_autoconf_config.hpp:144
ContentHandler
Receive notification of general document events.
Definition ContentHandler.hpp:61
DOMNode
The DOMNode interface is the primary datatype for the entire Document Object Model.
Definition DOMNode.hpp:139
MemoryManager
Configurable memory manager.
Definition MemoryManager.hpp:40
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition PlatformUtils.hpp:121
XSAnnotation::~XSAnnotation
~XSAnnotation()
XSAnnotation::setSystemId
void setSystemId(const XMLCh *const systemId)
XSAnnotation::getSystemId
const XMLCh * getSystemId() const
Definition XSAnnotation.hpp:182
XSAnnotation::writeAnnotation
void writeAnnotation(ContentHandler *handler)
Write contents of the annotation to the specified object.
XSAnnotation::getAnnotationString
const XMLCh * getAnnotationString() const
A text representation of annotation.
Definition XSAnnotation.hpp:166
XSAnnotation::getNext
XSAnnotation * getNext()
XSAnnotation::writeAnnotation
void writeAnnotation(DOMNode *node, ANNOTATION_TARGET targetType)
Write contents of the annotation to the specified DOM object.
XSAnnotation::XSAnnotation
XSAnnotation(const XMLCh *const contents, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
The default constructor.
XSAnnotation::fNext
XSAnnotation * fNext
Definition XSAnnotation.hpp:156
XSAnnotation::ANNOTATION_TARGET
ANNOTATION_TARGET
Definition XSAnnotation.hpp:46
XSAnnotation::W3C_DOM_DOCUMENT
@ W3C_DOM_DOCUMENT
The object type is org.w3c.dom.Document.
Definition XSAnnotation.hpp:54
XSAnnotation::W3C_DOM_ELEMENT
@ W3C_DOM_ELEMENT
The object type is org.w3c.dom.Element.
Definition XSAnnotation.hpp:50
XSAnnotation::fContents
XMLCh * fContents
Definition XSAnnotation.hpp:155
XSAnnotation::setNext
void setNext(XSAnnotation *const nextAnnotation)
methods needed by implementation
XSAnnotation::setLineCol
void setLineCol(XMLFileLoc line, XMLFileLoc col)
Setter.
Definition XSAnnotation.hpp:187
XSAnnotation::getLineCol
void getLineCol(XMLFileLoc &line, XMLFileLoc &col) const
Getter.
Definition XSAnnotation.hpp:176
XSObject::XSObject
XSObject(XSConstants::COMPONENT_TYPE compType, XSModel *const xsModel, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
The default constructor.