IROPluginMessages
Overview
The IROPluginMessages interface logs problems during the validation of RODL structures from GUI tools like Service Builder.
The following example demonstrates the usage of this interface:
type
TValidator = class(TInterfacedObject , IROPluginMessages)
private
{ IROPluginMessages }
procedure AddMessage(iType: TRoPluginMessageType; const iSource: String;
const iMessage: String; aReserved: Integer = -1; aEntity: TRODLEntity = nil);
end;
procedure TValidator.AddMessage(iType: TRoPluginMessageType; const iSource: String;
const iMessage: String; aReserved: Integer = -1; aEntity: TRODLEntity = nil);
const
TRoPluginMessageTypeStrings :
array[Low(TRoPluginMessageType)..High(TRoPluginMessageType)] of string =
('Info', 'Hint', 'Warning', 'Error', 'Success', 'Custom');
begin
with RODLMainForm.Memo1.Lines do begin
Add(TRoPluginMessageTypeStrings[iType]);
Add('---------');
Add('Source' +': '+iSource);
Add('Message' +': '+iMessage);
Add(`);
end;
end;
procedure TRODLMainForm.Button2Click(Sender: TObject);
begin
fLibrary.Validate(TValidator.Create);
end;
The output can be one of the following: Error:
Source: Default.Sum Message: Duplicate name.
Location
- Unit: uRODL.pas
- Ancestry: IROPluginMessages
Required Methods
AddMessage
Adds messages.
procedure AddMessage(iType: TROPluginMessageType; const iSource: string; const iMessage: string; aReserved: Integer; aEntity: TRODLEntity)
Parameters:
- iType: type of message.
TRoPluginMessageType = (rmtInfo, rmtHint, rmtWarning, rmtError, rmtSuccess, rmtCustom); - iSource: Original string
- iMessage: Message string
- aReserved: Not used
- aEntity: TRODLEntity