29#ifndef __NCML_MODULE__NCMLELEMENT_H__
30#define __NCML_MODULE__NCMLELEMENT_H__
34#include "XMLHelpers.h"
95 typedef std::vector<const NCMLElement*> ProtoList;
102 void addPrototype(
const NCMLElement* proto);
105 ProtoList::iterator findPrototype(
const std::string& elementTypeName);
114 NCMLElement(
const NCMLElement& proto);
118 NCMLElement& operator=(
const NCMLElement& rhs);
121 virtual ~NCMLElement();
135 virtual NCMLElement*
clone()
const = 0;
149 std::vector<std::string>* pInvalidAttrs = 0,
bool printInvalid =
true,
bool throwOnError =
true);
177 static bool isValidAttribute(
const std::vector<std::string>& validAttrs,
const std::string& attr);
183 std::vector<std::string>* pInvalidAttributes = 0);
A base class for a simple reference counted object.
A reference to an RCObject which automatically ref() and deref() on creation and destruction.
RCPtr< NCMLElement > makeElement(const std::string &eltTypeName, const XMLAttributeMap &attrs, NCMLParser &parser)
Base class for NcML element concrete classes.
static std::string printAttributeIfNotEmpty(const std::string &attrName, const std::string &attrValue)
virtual void setAttributes(const XMLAttributeMap &attrs)=0
static bool isValidAttribute(const std::vector< std::string > &validAttrs, const std::string &attr)
virtual NCMLElement * clone() const =0
virtual const std::string & getTypeName() const =0
virtual void handleContent(const std::string &content)
virtual std::string toString() const =0
virtual void handleBegin()=0
virtual void handleEnd()=0
virtual bool validateAttributes(const XMLAttributeMap &attrs, const std::vector< std::string > &validAttrs, std::vector< std::string > *pInvalidAttrs=0, bool printInvalid=true, bool throwOnError=true)
static bool areAllAttributesValid(const XMLAttributeMap &attrMap, const std::vector< std::string > &validAttrs, std::vector< std::string > *pInvalidAttributes=0)
NcML Parser for adding/modifying/removing metadata (attributes) to existing local datasets using NcML...