29 #include "ExplicitElement.h"
30 #include "NCMLDebug.h"
31 #include "NCMLParser.h"
33 #include "NetcdfElement.h"
37 const string ExplicitElement::_sTypeName =
"explicit";
38 const vector<string> ExplicitElement::_sValidAttributes = vector<string>();
40 ExplicitElement::ExplicitElement() :
45 ExplicitElement::ExplicitElement(
const ExplicitElement& ) :
46 RCObjectInterface(), NCMLElement(0)
50 ExplicitElement::~ExplicitElement()
55 ExplicitElement::getTypeName()
const
61 ExplicitElement::clone()
const
70 validateAttributes(attrs, _sValidAttributes);
73 void ExplicitElement::handleBegin()
76 if (!p.isScopeNetcdf()) {
77 THROW_NCML_PARSE_ERROR(_parser->getParseLineNumber(),
"Got <explicit/> while not a direct child of a <netcdf>");
83 if (dataset->getProcessedMetadataDirective()) {
84 THROW_NCML_PARSE_ERROR(_parser->getParseLineNumber(),
86 +
" element but we already got a metadata directive for the current dataset! Only one may be specified.");
89 dataset->setProcessedMetadataDirective();
90 VALID_PTR(dataset->
getDDS());
91 p.clearAllAttrTables(dataset->
getDDS());
94 void ExplicitElement::handleContent(
const string& content)
96 if (!NCMLUtil::isAllWhitespace(content)) {
97 THROW_NCML_PARSE_ERROR(_parser->getParseLineNumber(),
98 "Got non-whitespace for element content and didn't expect it. Element=" + toString() +
" content=\""
103 void ExplicitElement::handleEnd()
107 string ExplicitElement::toString()
const
109 return "<" + _sTypeName +
">";