|
void | checkDataIsValidForCanonicalTypeOrThrow (const string &type, const vector< string > &tokens) const |
| Make sure the given tokens are valid for the listed type. For example, makes sure floats are well formed, UInt16 are unsigned, etc. A successful call will return normally, else we throw an exception.
|
|
int | getParseLineNumber () const |
|
const XMLNamespaceStack & | getXMLNamespaceStack () const |
|
| NCMLParser (agg_util::DDSLoader &loader) |
| Create a structure that can parse an NCML filename and returned a transformed response of requested type.
|
|
virtual void | onCharacters (const std::string &content) |
|
virtual void | onEndDocument () |
|
virtual void | onEndElement (const std::string &name) |
|
virtual void | onEndElementWithNamespace (const std::string &localname, const std::string &prefix, const std::string &uri) |
|
virtual void | onParseError (std::string msg) |
|
virtual void | onParseWarning (std::string msg) |
|
virtual void | onStartDocument () |
|
virtual void | onStartElement (const std::string &name, const XMLAttributeMap &attrs) |
|
virtual void | onStartElementWithNamespace (const std::string &localname, const std::string &prefix, const std::string &uri, const XMLAttributeMap &attributes, const XMLNamespaceMap &namespaces) |
|
std::unique_ptr< BESDapResponse > | parse (const std::string &ncmlFilename, agg_util::DDSLoader::ResponseType type) |
| Parse the NcML filename, returning a newly allocated DDS response containing the underlying dataset transformed by the NcML. The caller owns the returned memory.
|
|
void | parseInto (const string &ncmlFilename, agg_util::DDSLoader::ResponseType responseType, BESDapResponse *response) |
| Same as parse, but the response object to parse into is passed down by the caller rather than created.
|
|
bool | parsing () const |
|
virtual void | setParseLineNumber (int line) |
|
Definition at line 158 of file NCMLParser.h.
◆ NCMLParser()
Create a structure that can parse an NCML filename and returned a transformed response of requested type.
- Parameters
-
loader | helper for loading a location referred to in the ncml. |
Definition at line 136 of file NCMLParser.cc.
◆ ~NCMLParser()
ncml_module::NCMLParser::~NCMLParser |
( |
| ) |
|
|
virtual |
◆ checkDataIsValidForCanonicalTypeOrThrow()
void ncml_module::NCMLParser::checkDataIsValidForCanonicalTypeOrThrow |
( |
const string & | type, |
|
|
const vector< string > & | tokens ) const |
Make sure the given tokens are valid for the listed type. For example, makes sure floats are well formed, UInt16 are unsigned, etc. A successful call will return normally, else we throw an exception.
- Exceptions
-
BESUserSyntaxError | on invalid values. |
Definition at line 969 of file NCMLParser.cc.
◆ convertNcmlTypeToCanonicalType()
string ncml_module::NCMLParser::convertNcmlTypeToCanonicalType |
( |
const string & | ncmlType | ) |
|
|
static |
Convert the NCML type in ncmlType into a canonical type we will use in the parser. Specifically, we map NcML types to their closest DAP equivalent type, but we leave Structure as Structure since it is assumed to mean Constructor for DAP which is a superclass type. Note this passes DAP types through unchanged as well. It is illegal for ncmlType
to be empty(). We return "" to indicate an error in conversion.
- Parameters
-
ncmlType | a non empty() string that could be an NcML type (or built-in DAP type) |
- Returns
- the converted type or "" if unknown type.
Definition at line 945 of file NCMLParser.cc.
◆ getParseLineNumber()
int ncml_module::NCMLParser::getParseLineNumber |
( |
| ) |
const |
Get the line of the NCML file the parser is currently parsing
Definition at line 201 of file NCMLParser.cc.
◆ getXMLNamespaceStack()
If using namespaces, get the current stack of namespaces. Might be empty.
Definition at line 207 of file NCMLParser.cc.
◆ onCharacters()
void ncml_module::NCMLParser::onCharacters |
( |
const std::string & | content | ) |
|
|
virtual |
Called when characters are encountered within an element. content is only valid for the call duration. Note: this will return all whitespace in the document as well, which makes it messy to use.
Implements ncml_module::SaxParser.
Definition at line 330 of file NCMLParser.cc.
◆ onEndDocument()
void ncml_module::NCMLParser::onEndDocument |
( |
| ) |
|
|
virtual |
◆ onEndElement()
void ncml_module::NCMLParser::onEndElement |
( |
const std::string & | name | ) |
|
|
virtual |
◆ onEndElementWithNamespace()
void ncml_module::NCMLParser::onEndElementWithNamespace |
( |
const std::string & | localname, |
|
|
const std::string & | prefix, |
|
|
const std::string & | uri ) |
|
virtual |
SAX2 End element with namespace information.
- Parameters
-
localname | the localname of the element |
prefix | the namespace prefix or "" on the element |
uri | the uri (or "") associated with the namespace of the element. |
Implements ncml_module::SaxParser.
Definition at line 299 of file NCMLParser.cc.
◆ onParseError()
void ncml_module::NCMLParser::onParseError |
( |
std::string | msg | ) |
|
|
virtual |
◆ onParseWarning()
void ncml_module::NCMLParser::onParseWarning |
( |
std::string | msg | ) |
|
|
virtual |
◆ onStartDocument()
void ncml_module::NCMLParser::onStartDocument |
( |
| ) |
|
|
virtual |
◆ onStartElement()
void ncml_module::NCMLParser::onStartElement |
( |
const std::string & | name, |
|
|
const XMLAttributeMap & | attrs ) |
|
virtual |
◆ onStartElementWithNamespace()
void ncml_module::NCMLParser::onStartElementWithNamespace |
( |
const std::string & | localname, |
|
|
const std::string & | prefix, |
|
|
const std::string & | uri, |
|
|
const XMLAttributeMap & | attributes, |
|
|
const XMLNamespaceMap & | namespaces ) |
|
virtual |
SAX2 start element call with gets namespace information.
- Parameters
-
localname | the localname of the element |
prefix | the namespace prefix of the element, or "" if none. |
uri | the uri for the namespace of the element. |
attributes | table of the attributes (excluding namespace attributes prefixed with xmlns) |
namespace | table of all the namespaces specification on this element |
Implements ncml_module::SaxParser.
Definition at line 283 of file NCMLParser.cc.
◆ parse()
Parse the NcML filename, returning a newly allocated DDS response containing the underlying dataset transformed by the NcML. The caller owns the returned memory.
- Exceptions
-
BESSyntaxUserError | for parse errors such as bad XML or NcML referring to variables that do not exist. |
BESInternalError | for assertion failures, null ptr exceptions, or logic errors. |
- Returns
- a new response object with the transformed DDS in it. The caller assumes ownership of the returned object. It will be of type BESDDSResponse or BESDataDDSResponse depending on the request being processed.
Definition at line 150 of file NCMLParser.cc.
◆ parseInto()
Same as parse, but the response object to parse into is passed down by the caller rather than created.
- Parameters
-
ncmlFilename | the ncml file to parse |
responseType | the type of response. Must match response. |
response | the premade response object. The caller owns this memory. |
Definition at line 163 of file NCMLParser.cc.
◆ parsing()
bool ncml_module::NCMLParser::parsing |
( |
| ) |
const |
◆ setParseLineNumber()
void ncml_module::NCMLParser::setParseLineNumber |
( |
int | | ) |
|
|
virtual |
Before any of the callbacks are issued, this function is called to let the implementing parser know what line number in the parse the next callback is being issued from to allow for more informative error messages. (Default impl is to ignore it now).
Reimplemented from ncml_module::SaxParser.
Definition at line 359 of file NCMLParser.cc.
◆ AggregationElement
◆ AttributeElement
◆ AttrTableLazyPtr
◆ DimensionElement
◆ ExplicitElement
◆ NetcdfElement
◆ ReadMetadataElement
◆ RemoveElement
◆ ScanElement
◆ ValuesElement
◆ VariableAggElement
◆ VariableElement
◆ STRUCTURE_TYPE
const string ncml_module::NCMLParser::STRUCTURE_TYPE |
|
static |
The string describing the type "Structure"
Definition at line 577 of file NCMLParser.h.
The documentation for this class was generated from the following files: