org::xmlBlaster::util::XmlHandlerBase Class Reference

Abstraction for the xml handling. More...

Inheritance diagram for org::xmlBlaster::util::XmlHandlerBase:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual void init (const std::string &xmlLiteral)=0
virtual std::string toString ()=0
 
Returns:
returns the literal xml std::string

virtual std::string toXml ()=0
 
Returns:
returns the literal xml std::string

virtual void startDocument ()=0
 Start document.
virtual void startElement (const std::string &name, Attributes &attrs)=0
 Start element.
virtual void characters (const std::string &ch)=0
 Characters.
virtual void ignorableWhitespace (const std::string &ch)=0
 Ignorable whitespace.
void endElement (const std::string &name)=0
 End element.
virtual void endDocument ()=0
 End document.
virtual void warning (const XmlBlasterException &ex)=0
 Warning.
virtual void error (const XmlBlasterException &ex)=0
 Error.
virtual void fatalError (const XmlBlasterException &ex)=0
 Fatal error.
void endCDATA ()=0
void startCDATA ()=0
int getIntValue (const std::string &value) const
 returns a value (usually from an attribute) as an integer
long getLongValue (const std::string &value) const
 returns a value (usually from an attribute) as a long
Timestamp getTimestampValue (const std::string &value) const
 returns a value (usually from an attribute) as a Timestamp
bool getBoolValue (const std::string &value) const
 returns a value (usually from an attribute) as a bool
bool getStringAttr (const Attributes &attrs, const std::string &name, std::string &value, bool doTrim=true) const
 gets the attribute specified by 'name' in the attribute list specified by 'list'.
bool getIntAttr (const Attributes &attrs, const std::string &name, int &value) const
 gets the attribute specified by 'name' in the attribute list specified by 'list'.
bool getLongAttr (const Attributes &attrs, const std::string &name, long &value) const
 gets the attribute specified by 'name' in the attribute list specified by 'list'.
bool getTimestampAttr (const Attributes &attrs, const std::string &name, Timestamp &value) const
 gets the attribute specified by 'name' in the attribute list specified by 'list'.
bool getBoolAttr (const Attributes &attrs, const std::string &name, bool &value) const
 gets the attribute specified by 'name' in the attribute list specified by 'list'.

Detailed Description

Abstraction for the xml handling.

You may use this as the interface to extend in your specific XML handling (example SAX2).

Definition at line 26 of file I_XmlHandler.h.


Member Function Documentation

virtual void org::xmlBlaster::util::XmlHandlerBase::init ( const std::string &  xmlLiteral  )  [pure virtual]

virtual std::string org::xmlBlaster::util::XmlHandlerBase::toString (  )  [pure virtual]

Returns:
returns the literal xml std::string

virtual std::string org::xmlBlaster::util::XmlHandlerBase::toXml (  )  [pure virtual]

Returns:
returns the literal xml std::string

void org::xmlBlaster::util::parser::XmlHandlerBase::startDocument (  )  [pure virtual]

Start document.

Definition at line 164 of file XmlHandlerBase.cpp.

Referenced by org::xmlBlaster::util::parser::Sax2Parser::startDocument().

virtual void org::xmlBlaster::util::XmlHandlerBase::startElement ( const std::string &  name,
Attributes attrs 
) [pure virtual]

Start element.

Referenced by org::xmlBlaster::util::parser::Sax2Parser::startElement().

virtual void org::xmlBlaster::util::XmlHandlerBase::characters ( const std::string &  ch  )  [pure virtual]

Characters.

The text between two tags, in the following example 'Hello': <key>Hello</key>. This method is different from the java version since the c++ parser always starts at the first character, so you don't specify start.

Referenced by org::xmlBlaster::util::parser::Sax2Parser::characters().

virtual void org::xmlBlaster::util::XmlHandlerBase::ignorableWhitespace ( const std::string &  ch  )  [pure virtual]

Ignorable whitespace.

void org::xmlBlaster::util::XmlHandlerBase::endElement ( const std::string &  name  )  [pure virtual]

End element.

Referenced by org::xmlBlaster::util::parser::Sax2Parser::endElement().

void org::xmlBlaster::util::parser::XmlHandlerBase::endDocument (  )  [pure virtual]

End document.

Definition at line 169 of file XmlHandlerBase.cpp.

Referenced by org::xmlBlaster::util::parser::Sax2Parser::endDocument().

virtual void org::xmlBlaster::util::XmlHandlerBase::warning ( const XmlBlasterException ex  )  [pure virtual]

Warning.

Referenced by org::xmlBlaster::util::parser::Sax2Parser::warning().

virtual void org::xmlBlaster::util::XmlHandlerBase::error ( const XmlBlasterException ex  )  [pure virtual]

Error.

Referenced by org::xmlBlaster::util::parser::Sax2Parser::error().

virtual void org::xmlBlaster::util::XmlHandlerBase::fatalError ( const XmlBlasterException ex  )  [pure virtual]

Fatal error.

Referenced by org::xmlBlaster::util::parser::Sax2Parser::fatalError().

void org::xmlBlaster::util::parser::XmlHandlerBase::endCDATA (  )  [pure virtual]

Definition at line 144 of file XmlHandlerBase.cpp.

Referenced by org::xmlBlaster::util::parser::Sax2Parser::endCDATA().

void org::xmlBlaster::util::parser::XmlHandlerBase::startCDATA (  )  [pure virtual]

Definition at line 154 of file XmlHandlerBase.cpp.

Referenced by org::xmlBlaster::util::parser::Sax2Parser::startCDATA().

int org::xmlBlaster::util::XmlHandlerBase::getIntValue ( const std::string &  value  )  const

returns a value (usually from an attribute) as an integer

long org::xmlBlaster::util::XmlHandlerBase::getLongValue ( const std::string &  value  )  const

returns a value (usually from an attribute) as a long

Timestamp org::xmlBlaster::util::XmlHandlerBase::getTimestampValue ( const std::string &  value  )  const

returns a value (usually from an attribute) as a Timestamp

bool org::xmlBlaster::util::XmlHandlerBase::getBoolValue ( const std::string &  value  )  const

returns a value (usually from an attribute) as a bool

bool org::xmlBlaster::util::XmlHandlerBase::getStringAttr ( const Attributes attrs,
const std::string &  name,
std::string &  value,
bool  doTrim = true 
) const

gets the attribute specified by 'name' in the attribute list specified by 'list'.

The result is put in the 'value' argument which is passed by reference. It returns 'true' if the attribute was found in the specified attribute list or 'false' if it was not. In the later case, the value is untouched by this method. If the 'doTrim' argument is set to true, the std::string is trimmed before it is given back.

bool org::xmlBlaster::util::XmlHandlerBase::getIntAttr ( const Attributes attrs,
const std::string &  name,
int &  value 
) const

gets the attribute specified by 'name' in the attribute list specified by 'list'.

The result is put in the 'value' argument which is passed by reference. It returns 'true' if the attribute was found in the specified attribute list or 'false' if it was not. In the later case, the value is untouched by this method.

bool org::xmlBlaster::util::XmlHandlerBase::getLongAttr ( const Attributes attrs,
const std::string &  name,
long &  value 
) const

gets the attribute specified by 'name' in the attribute list specified by 'list'.

The result is put in the 'value' argument which is passed by reference. It returns 'true' if the attribute was found in the specified attribute list or 'false' if it was not. In the later case, the value is untouched by this method.

bool org::xmlBlaster::util::XmlHandlerBase::getTimestampAttr ( const Attributes attrs,
const std::string &  name,
Timestamp value 
) const

gets the attribute specified by 'name' in the attribute list specified by 'list'.

The result is put in the 'value' argument which is passed by reference. It returns 'true' if the attribute was found in the specified attribute list or 'false' if it was not. In the later case, the value is untouched by this method.

bool org::xmlBlaster::util::XmlHandlerBase::getBoolAttr ( const Attributes attrs,
const std::string &  name,
bool &  value 
) const

gets the attribute specified by 'name' in the attribute list specified by 'list'.

The result is put in the 'value' argument which is passed by reference. It returns 'true' if the attribute was found in the specified attribute list or 'false' if it was not. In the later case, the value is untouched by this method.


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