OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
ncml_module::SimpleLocationParser Class Referenceabstract

SaxParser implementation that just grabs the netcdf attribute and returns it. More...

#include <SimpleLocationParser.h>

Inheritance diagram for ncml_module::SimpleLocationParser:
Inheritance graph
Collaboration diagram for ncml_module::SimpleLocationParser:
Collaboration graph

Public Member Functions

virtual void onCharacters (const std::string &)
 Called when characters are encountered within an element. More...
 
virtual void onEndDocument ()
 
virtual void onEndElement (const std::string &)
 
virtual void onEndElementWithNamespace (const std::string &localname, const std::string &prefix, const std::string &uri)=0
 SAX2 End element with namespace information. More...
 
virtual void onParseError (std::string msg)
 An unrecoverable parse error occurred. More...
 
virtual void onParseWarning (std::string msg)
 A recoverable parse error occured. More...
 
virtual void onStartDocument ()
 
virtual void onStartElement (const std::string &name, const XMLAttributeMap &attrs)
 We only use this get the the nedcdf attribute out. More...
 
virtual void onStartElementWithNamespace (const std::string &localname, const std::string &prefix, const std::string &uri, const XMLAttributeMap &attributes, const XMLNamespaceMap &namespaces)=0
 SAX2 start element call with gets namespace information. More...
 
std::string parseAndGetLocation (const std::string &filename)
 Parse the NcML filename and return the netcdf attribute, assuming there's only one netCDF node. More...
 
virtual void setParseLineNumber (int)
 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. More...
 
 SimpleLocationParser ()
 
virtual ~SimpleLocationParser ()
 

Detailed Description

SaxParser implementation that just grabs the netcdf attribute and returns it.

See also
parseAndGetLocation()

Currently will still process the entire file. TODO maybe find a way to early exit?

Author
Michael Johnson m.joh.nosp@m.nson.nosp@m.@open.nosp@m.dap..nosp@m.org

Definition at line 47 of file SimpleLocationParser.h.

Constructor & Destructor Documentation

SimpleLocationParser::SimpleLocationParser ( )

Definition at line 40 of file SimpleLocationParser.cc.

SimpleLocationParser::~SimpleLocationParser ( )
virtual

Definition at line 45 of file SimpleLocationParser.cc.

Member Function Documentation

virtual void ncml_module::SimpleLocationParser::onCharacters ( const std::string &  content)
inlinevirtual

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 71 of file SimpleLocationParser.h.

virtual void ncml_module::SimpleLocationParser::onEndDocument ( )
inlinevirtual

Implements ncml_module::SaxParser.

Definition at line 65 of file SimpleLocationParser.h.

virtual void ncml_module::SimpleLocationParser::onEndElement ( const std::string &  name)
inlinevirtual
Deprecated:
We are preferring onEndElementWithNamespace() now. Called at the end of the element with the given name. The args are only valid for the duration of the call, so copy if necessary to keep.

Implements ncml_module::SaxParser.

Definition at line 70 of file SimpleLocationParser.h.

virtual void ncml_module::SaxParser::onEndElementWithNamespace ( const std::string &  localname,
const std::string &  prefix,
const std::string &  uri 
)
pure virtualinherited

SAX2 End element with namespace information.

Parameters
localnamethe localname of the element
prefixthe namespace prefix or "" on the element
urithe uri (or "") associated with the namespace of the element.

Implemented in ncml_module::NCMLParser, and ncml_module::OtherXMLParser.

void SimpleLocationParser::onParseError ( std::string  msg)
virtual

An unrecoverable parse error occurred.

Implements ncml_module::SaxParser.

Definition at line 76 of file SimpleLocationParser.cc.

References BESDEBUG.

void SimpleLocationParser::onParseWarning ( std::string  msg)
virtual

A recoverable parse error occured.

Implements ncml_module::SaxParser.

Definition at line 70 of file SimpleLocationParser.cc.

References BESDEBUG.

virtual void ncml_module::SimpleLocationParser::onStartDocument ( )
inlinevirtual

Implements ncml_module::SaxParser.

Definition at line 64 of file SimpleLocationParser.h.

void SimpleLocationParser::onStartElement ( const std::string &  name,
const XMLAttributeMap attrs 
)
virtual

We only use this get the the nedcdf attribute out.

Implements ncml_module::SaxParser.

Definition at line 61 of file SimpleLocationParser.cc.

References ncml_module::XMLAttributeMap::getValueForLocalNameOrDefault().

Here is the call graph for this function:

virtual void ncml_module::SaxParser::onStartElementWithNamespace ( const std::string &  localname,
const std::string &  prefix,
const std::string &  uri,
const XMLAttributeMap attributes,
const XMLNamespaceMap namespaces 
)
pure virtualinherited

SAX2 start element call with gets namespace information.

Parameters
localnamethe localname of the element
prefixthe namespace prefix of the element, or "" if none.
urithe uri for the namespace of the element.
attributestable of the attributes (excluding namespace attributes prefixed with xmlns)
namespacetable of all the namespaces specification on this element

Implemented in ncml_module::NCMLParser, and ncml_module::OtherXMLParser.

string SimpleLocationParser::parseAndGetLocation ( const std::string &  filename)

Parse the NcML filename and return the netcdf attribute, assuming there's only one netCDF node.

If more than one, we'll get the last node's location.

Definition at line 51 of file SimpleLocationParser.cc.

References ncml_module::SaxParserWrapper::parse().

Here is the call graph for this function:

virtual void ncml_module::SaxParser::setParseLineNumber ( int  )
inlinevirtualinherited

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 in ncml_module::NCMLParser.

Definition at line 119 of file SaxParser.h.


The documentation for this class was generated from the following files: