NAME

Business::CAMT::Message - base class for messages

SYNOPSIS

my $camt = Business::CAMT->new(...);

my $msg  = $camt->read(...);
my $msg  = $camt->create(...);

$msg->write('file.xml');
print $msg->toPerl;

open my $fh, '>:raw', 'msg.json' and $fh->print($msg->toJSON);

DESCRIPTION

This module is the base class for objects which are able to interpret the CAMT messages.

METHODS

Constructors

Business::CAMT::Message->fromData(%options)

This method accepts the same %options as new(). All options passed in are passed to that constructor.

Business::CAMT::Message->new(%options)

The data (probably read from a file) is wrapped into this class. When data is undef, then undef will be returned.

-Option --Default
 camt     <required>
 data     <required>
 set      <required>
 version  <required>
camt => Business::CAMT object
data => HASH
set => STRING
version => STRING

Accessors

$obj->camt()
$obj->set()
$obj->version()

Other

$obj->toJSON(%options)

Returns JSON raw text (bytes, not characters) for the data. You may save this to a file (explicitly use encoding ":raw"), or write it to a database. The keys get sorted, to ensure a reproducable result for regression tests.

-Option  --Default
 settings  {pretty => 1, canonical => 1}
settings => HASH

Pass the settings to the JSON generator object, see its manual page. Provided settings will overrule the defaults.

$obj->toPerl()

Convert the HASH into Perl code, using Data::Dumper. This is useful, because you do not want to include the hidden object attributes in your output: this method hides that administration.

$obj->write($file, %options)

All %options are passed to Business::CAMT::write().

example: for write

$msg->write($file);
$camt->write($file, $msg);   # same

SEE ALSO

This module is part of Business-CAMT distribution version 0.13, built on December 02, 2024. Website: http://perl.overmeer.net/CPAN/

LICENSE

Copyrights 2024 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/

1 POD Error

The following errors were encountered while parsing the POD:

Around line 32:

Deleting unknown formatting code N<>