35 if (!document.LoadFile())
37 MITK_ERROR <<
"Could not open/read/parse " <<
m_Filename <<
"\nTinyXML reports: " << document.ErrorDesc()
42 for (TiXmlElement *propertyElement = document.FirstChildElement(
"property"); propertyElement !=
nullptr;
43 propertyElement = propertyElement->NextSiblingElement(
"property"))
45 const char *keya = propertyElement->Attribute(
"key");
46 std::string key(keya ? keya :
"");
48 const char *typea = propertyElement->Attribute(
"type");
49 std::string type(typea ? typea :
"");
52 std::stringstream propertyDeserializerClassName;
53 propertyDeserializerClassName << type <<
"Serializer";
55 std::list<itk::LightObject::Pointer> readers =
56 itk::ObjectFactoryBase::CreateAllInstance(propertyDeserializerClassName.str().c_str());
57 if (readers.size() < 1)
59 MITK_ERROR <<
"No property reader found for " << type;
62 if (readers.size() > 1)
64 MITK_WARN <<
"Multiple property readers found for " << type <<
". Using arbitrary first one.";
67 for (
auto iter = readers.begin(); iter != readers.end(); ++iter)
69 if (
auto *reader = dynamic_cast<BasePropertySerializer *>(iter->GetPointer()))
72 if (property.IsNotNull())
78 MITK_ERROR <<
"There were errors while loading property '" << key <<
"' of type " << type
79 <<
". Your data may be corrupted";
#define MITK_REGISTER_SERIALIZER(classname)
PropertyList::Pointer m_PropertyList
Deserializes a mitk::PropertyList.
DataCollection - Class to facilitate loading/accessing structured data.
bool Deserialize() override
Reads a propertylist from file. Get result via GetOutput()
~PropertyListDeserializerV1() override