Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::PropertyListSerializer Class Reference

Serializes a mitk::PropertyList to an XML file. More...

#include <mitkPropertyListSerializer.h>

Inheritance diagram for mitk::PropertyListSerializer:
Collaboration diagram for mitk::PropertyListSerializer:

Public Member Functions

 mitkClassMacroItkParent (PropertyListSerializer, itk::Object)
 
Pointer Clone () const
 
virtual void SetFilenameHint (const char *_arg)
 Sets a hint for the output filename (without path or extension). More...
 
virtual const char * GetFilenameHint () const
 Returns the current filename hint. More...
 
virtual void SetWorkingDirectory (const char *_arg)
 Sets the working directory where the serialized XML file will be stored. More...
 
virtual const char * GetWorkingDirectory () const
 Returns the current working directory. More...
 
virtual void SetPropertyList (PropertyList *_arg)
 Sets the PropertyList to be serialized. More...
 
virtual std::string Serialize ()
 Serializes the previously set PropertyList to an XML file. More...
 
PropertyList * GetFailedProperties ()
 Returns properties that failed to serialize during the last Serialize() call. More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 PropertyListSerializer ()
 
 ~PropertyListSerializer () override
 
tinyxml2::XMLElement * SerializeOneProperty (tinyxml2::XMLDocument &doc, const std::string &key, const BaseProperty *property)
 

Protected Attributes

std::string m_FilenameHint
 
std::string m_WorkingDirectory
 
PropertyList::Pointer m_PropertyList
 
PropertyList::Pointer m_FailedProperties
 

Detailed Description

Serializes a mitk::PropertyList to an XML file.

Iterates over all properties in the assigned PropertyList, uses the appropriate BasePropertySerializer for each property type (discovered via the ITK object factory), and writes the results as an XML file to the working directory.

Properties that cannot be serialized (no serializer found, serializer failure, etc.) are collected and can be retrieved via GetFailedProperties().

See also
BasePropertySerializer, SceneIO

Definition at line 43 of file mitkPropertyListSerializer.h.

Constructor & Destructor Documentation

◆ PropertyListSerializer()

mitk::PropertyListSerializer::PropertyListSerializer ( )
protected

◆ ~PropertyListSerializer()

mitk::PropertyListSerializer::~PropertyListSerializer ( )
overrideprotected

Member Function Documentation

◆ Clone()

Pointer mitk::PropertyListSerializer::Clone ( ) const

◆ GetFailedProperties()

PropertyList* mitk::PropertyListSerializer::GetFailedProperties ( )

Returns properties that failed to serialize during the last Serialize() call.

Returns
Pointer to a PropertyList containing all properties for which serialization failed, or nullptr if all properties were serialized successfully.

◆ GetFilenameHint()

virtual const char* mitk::PropertyListSerializer::GetFilenameHint ( ) const
virtual

Returns the current filename hint.

◆ GetWorkingDirectory()

virtual const char* mitk::PropertyListSerializer::GetWorkingDirectory ( ) const
virtual

Returns the current working directory.

◆ mitkClassMacroItkParent()

mitk::PropertyListSerializer::mitkClassMacroItkParent ( PropertyListSerializer  ,
itk::Object   
)

◆ New()

static Pointer mitk::PropertyListSerializer::New ( )
static

◆ Serialize()

virtual std::string mitk::PropertyListSerializer::Serialize ( )
virtual

Serializes the previously set PropertyList to an XML file.

Writes an XML file containing all properties from the PropertyList into the working directory. Each property is serialized using its corresponding BasePropertySerializer, discovered via the ITK object factory.

Returns
The filename (without path) of the created XML file, or an empty string if the PropertyList is null/empty or writing fails.
Precondition
The PropertyList must be set via SetPropertyList().
The WorkingDirectory must be set via SetWorkingDirectory().
Postcondition
Properties that could not be serialized are available via GetFailedProperties().

◆ SerializeOneProperty()

tinyxml2::XMLElement* mitk::PropertyListSerializer::SerializeOneProperty ( tinyxml2::XMLDocument &  doc,
const std::string &  key,
const BaseProperty *  property 
)
protected

◆ SetFilenameHint()

virtual void mitk::PropertyListSerializer::SetFilenameHint ( const char *  _arg)
virtual

Sets a hint for the output filename (without path or extension).

◆ SetPropertyList()

virtual void mitk::PropertyListSerializer::SetPropertyList ( PropertyList *  _arg)
virtual

Sets the PropertyList to be serialized.

Parameters
[in]_argPointer to the PropertyList.

◆ SetWorkingDirectory()

virtual void mitk::PropertyListSerializer::SetWorkingDirectory ( const char *  _arg)
virtual

Sets the working directory where the serialized XML file will be stored.

Member Data Documentation

◆ m_FailedProperties

PropertyList::Pointer mitk::PropertyListSerializer::m_FailedProperties
protected

Definition at line 101 of file mitkPropertyListSerializer.h.

◆ m_FilenameHint

std::string mitk::PropertyListSerializer::m_FilenameHint
protected

Definition at line 97 of file mitkPropertyListSerializer.h.

◆ m_PropertyList

PropertyList::Pointer mitk::PropertyListSerializer::m_PropertyList
protected

Definition at line 99 of file mitkPropertyListSerializer.h.

◆ m_WorkingDirectory

std::string mitk::PropertyListSerializer::m_WorkingDirectory
protected

Definition at line 98 of file mitkPropertyListSerializer.h.


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