note description: "Send message. GENERATED DO NOT MODIFY" author: "Origo Team " date: "$Date$" revision: "$Revision$" class A_MAIL_SEND_MESSAGE inherit A_MESSAGE rename make as make_aranea_message end A_MAIL_CONSTANTS undefine is_equal, out end create make, make_from_tokenizer create {A_MESSAGE_FACTORY} make_from_ems_message feature {NONE} -- Initialization make (a_recipient: like recipient; a_sender: like sender; a_subject: like subject; a_text: like text) -- Create require a_recipient_not_empty: a_recipient /= Void and then not a_recipient.is_empty a_sender_not_empty: a_sender /= Void and then not a_sender.is_empty a_subject_not_empty: a_subject /= Void and then not a_subject.is_empty a_text_not_empty: a_text /= Void and then not a_text.is_empty do make_aranea_message recipient := a_recipient sender := a_sender subject := a_subject text := a_text ensure recipient_set: recipient = a_recipient sender_set: sender = a_sender subject_set: subject = a_subject text_set: text = a_text end feature -- Message handling handle (a_handler: A_MAIL_SEND_MESSAGE_HANDLER) -- do a_handler.handle_send (Current) end feature -- Access namespace: STRING -- Namespace of the message type. once Result := mail_namespace end type: STRING -- Type of the message. once Result := mail_send_type end recipient: A_STRING_VALUE -- Mail address of the recipient sender: A_STRING_VALUE -- Name of the sender subject: A_STRING_VALUE -- Subject of the message text: A_STRING_VALUE -- Text of the message feature {NONE} -- Implementation serialization_list: attached STRING -- Lists the fields to serialize, and under which name do create Result.make_empty Result.append ("%"" + recipient_argument + "%":") Result.append (recipient.serialize) Result.append (",") Result.append ("%"" + sender_argument + "%":") Result.append (sender.serialize) Result.append (",") Result.append ("%"" + subject_argument + "%":") Result.append (subject.serialize) Result.append (",") Result.append ("%"" + text_argument + "%":") Result.append (text.serialize) end parse_tag (a_tag: STRING; a_tokenizer: A_JSON_TOKENIZER) do if a_tag.is_equal (recipient_argument) then create recipient.make_from_tokenizer (a_tokenizer) elseif a_tag.is_equal (sender_argument) then create sender.make_from_tokenizer (a_tokenizer) elseif a_tag.is_equal (subject_argument) then create subject.make_from_tokenizer (a_tokenizer) elseif a_tag.is_equal (text_argument) then create text.make_from_tokenizer (a_tokenizer) end end recipient_argument: STRING = "recipient" sender_argument: STRING = "sender" subject_argument: STRING = "subject" text_argument: STRING = "text" invariant recipient_not_empty: recipient /= Void and then not recipient.is_empty sender_not_empty: sender /= Void and then not sender.is_empty subject_not_empty: subject /= Void and then not subject.is_empty text_not_empty: text /= Void and then not text.is_empty end