{:Whether to load the TComponent.Name property. Counterpart of <see property="TDnXmlWriter.StoreNameProperty" text="TDnXmlWriter.StoreNameProperty"/>.}
FromXmlAssignImp(mapper.ObjectProp[i] as TComponent, node, aObject)
else if SetObjPropMode in [sopmFreeAndSet, sopmTryAssignElseFreeAndSet] then
begin
if (mapper.ObjectProp[i] as TComponent).Owner = aObject then
begin
mapper.ObjectProp[i].Free;
mapper.ObjectProp[i] := nil;
end;
mapper.ObjectProp[i] := FromXmlCreateImp(aObject as TComponent, node);
end
else
mapper.ObjectProp[i] := FromXmlCreateImp(aObject as TComponent, node);
end;
end;
end
else
begin
if (mapper.ObjectProp[i] = nil) and (node.text <> 'nil')then
raise Exception.CreateFmt('Property %s.%s must be initialized because it is readonly and cannot be instantiated outside its owner object. It is also possible to make to property writable or non-stored', [aObject.ClassName, mapper.PropName[i]]);
if mapper.ObjectProp[i] <> nil then
FromXmlAssignImp(mapper.ObjectProp[i] as TComponent, node, aObject as TComponent);
end;
end
else
begin
obj := mapper.ObjectProp[i];
if (node.text = 'nil') and (obj <> nil) then
raise Exception.Create('Non TComponent objects instances cannot have "nil" as their xml data');
if (node.text <> 'nil') and (obj = nil) then
raise Exception.CreateFmt('Non TComponent objects cannot be instantiated from xml. Property %s was expected to have an object-instance assigned instead of nil', [mapper.PropName[i]]);