#include <librets/MetadataElement.h>
Public Types | |
enum | MetadataType { SYSTEM, RESOURCE, CLASS, TABLE, UPDATE, UPDATE_TYPE, OBJECT, SEARCH_HELP, EDIT_MASK, LOOKUP, LOOKUP_TYPE, UPDATE_HELP, VALIDATION_LOOKUP, VALIDATION_LOOKUP_TYPE, VALIDATION_EXTERNAL, VALIDATION_EXTERNAL_TYPE, VALIDATION_EXPRESSION, FOREIGN_KEY } |
Metadata types. More... | |
typedef MetadataType | Type |
Public Member Functions | |
MetadataElement () | |
virtual | ~MetadataElement () |
virtual MetadataType | GetType () const =0 |
Returns the type of metadata element. | |
StringVector | GetAttributeNames () const |
Returns all attirbute names. | |
std::string | GetStringAttribute (std::string attributeName, std::string defaultValue="") const |
Returns the value of an attribute. | |
int | GetIntAttribute (std::string attributeName, int defaultValue=0) const |
Returns the value of an attribute as an integer. | |
bool | GetBoolAttribute (std::string attributeName, bool defaultValue=false) const |
Returns the value of an attribute as a boolean. | |
void | SetAttribute (std::string attributeName, std::string attributeValue) |
Set the value of an attribute. | |
virtual std::string | GetId () const |
Returns the ID attribute. | |
std::string | GetLevel () const |
Returns the level of the current metadata element. | |
void | SetLevel (std::string level) |
Set the level for the current metadata element. | |
std::string | GetPath () const |
Returns the path of this element. | |
std::string | GetMetadataEntryID () const |
Returns the MetadataEntryId for the element. | |
virtual std::ostream & | Print (std::ostream &outputStream) const |
Prints the attribute in a standard form for debugging and error reporting. | |
std::string | ToString () const |
virtual bool | Equals (const RetsObject *object) const |
Protected Attributes | |
StringMap | mAttributes |
std::string | mLevel |
typedef MetadataType Type |
enum MetadataType |
Metadata types.
MetadataElement | ( | ) |
virtual ~MetadataElement | ( | ) | [virtual] |
virtual bool Equals | ( | const RetsObject * | object | ) | const [virtual, inherited] |
StringVector GetAttributeNames | ( | ) | const |
Returns all attirbute names.
bool GetBoolAttribute | ( | std::string | attributeName, | |
bool | defaultValue = false | |||
) | const |
Returns the value of an attribute as a boolean.
attributeName | A string containing the name of the attribute. | |
defaultValue | The value to use if the attribute does not exist. |
virtual std::string GetId | ( | ) | const [virtual] |
Returns the ID attribute.
The ID attribute is a non-empty and unique field used to identify this element within the scope of elements of the same type. Not all metadata elements have an identifying attribute. In these cases, an empty string is returned. The default implementation returns an empty string. Subclasses should override as needed.
Reimplemented in MetadataClass, MetadataEditMask, MetadataLookup, MetadataLookupType, MetadataObject, MetadataResource, MetadataSearchHelp, MetadataTable, MetadataUpdate, and MetadataUpdateHelp.
Referenced by MetadataElementIdEqual::operator()().
int GetIntAttribute | ( | std::string | attributeName, | |
int | defaultValue = 0 | |||
) | const |
Returns the value of an attribute as an integer.
attributeName | A string containing the name of the attribute. | |
defaultValue | The value to use if the attribute does not exist. |
std::string GetLevel | ( | ) | const |
Returns the level of the current metadata element.
std::string GetMetadataEntryID | ( | ) | const |
Returns the MetadataEntryId for the element.
std::string GetPath | ( | ) | const |
Returns the path of this element.
The path uniquely identifies this metadata element amongst all elements of the same type. Since this relies on the ID attribute, only those elements with an ID attribute have a non-empty path.
std::string GetStringAttribute | ( | std::string | attributeName, | |
std::string | defaultValue = "" | |||
) | const |
Returns the value of an attribute.
attributeName | A string containing the name of the attribute. | |
defaultValue | The value to use if the attribute does not exist. |
virtual MetadataType GetType | ( | ) | const [pure virtual] |
Returns the type of metadata element.
Implemented in MetadataClass, MetadataEditMask, MetadataForeignKey, MetadataLookup, MetadataLookupType, MetadataObject, MetadataResource, MetadataSearchHelp, MetadataSystem, MetadataTable, MetadataUpdate, MetadataUpdateHelp, MetadataUpdateType, MetadataValidationExpression, MetadataValidationExternal, MetadataValidationExternalType, MetadataValidationLookup, and MetadataValidationLookupType.
virtual std::ostream& Print | ( | std::ostream & | outputStream | ) | const [virtual] |
Prints the attribute in a standard form for debugging and error reporting.
Reimplemented from RetsObject.
void SetAttribute | ( | std::string | attributeName, | |
std::string | attributeValue | |||
) |
Set the value of an attribute.
attributeName | A string containing the name of the attribute. | |
attributeValue | A string containing the value of the attribute. |
void SetLevel | ( | std::string | level | ) |
Set the level for the current metadata element.
level | A string containing the level. |
std::string ToString | ( | ) | const [inherited] |
StringMap mAttributes [protected] |
std::string mLevel [protected] |