#include <textFileMetadataLoader.h>
Public Member Functions | |
TextFileMetadataLoader (std::string file) | |
virtual void | initializeMetadata () |
Implementations should set the class metadata or global settings here. |
The format of the configuration file is described by the following example:
# global level defaults[db.mapping.type];string;object # type level ::Person[db.type];string;Person_type # attribute level ::Person::name[db.type.length];int;20 # global settings globals[db.oracle.workaround.10gOO];bool;true
TextFileMetadataLoader skips all empty lines or lines starting with the '#' character. The file is case-sensitive. Lines describing the metadata contain three semicolon delimited values. First value specifies the location and code of the metadata to be set. It uses the same format as metadata in queries. Second column denotes the data type of the metadata value. Only string
, int
and bool
values are allowed. Last column contains the metadata value. Boolean values can be either true
or false
.
iopc::TextFileMetadataLoader::TextFileMetadataLoader | ( | std::string | file | ) | [inline] |
file | Name (or path) of the configuration file |
void TextFileMetadataLoader::initializeMetadata | ( | ) | [virtual] |
Implementations should set the class metadata or global settings here.
Typical implementation would load metadata from a configuration file and use TypeManager and related classes to set them on matching classes and attributes.
Implements iopc::MetadataInitializer.