The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SWIFT::Factory::Tag::Tag21 - Provide a TAG21 for a SWIFT message.

SYNOPSIS

  use SWIFT::Factory::Tag::Tag21;
  my $tag21 = SWIFT::Factory::Tag::Tag21->new( DO_CLEANUP=>0, REFERENCE=>'SOME_REF' );

DESCRIPTION

Tag 21 is used to provide the Related Reference in a SWIFT message. It is up to the sending party to make sure the reference is relevant.

CONSTRUCTOR

new( DO_CLEANUP=>0, REFERENCE=>'SOME_REF' );

    Instantiates a new Tag21 object.

    The parameters may be given in arbitrary order. Both parameters have built-in default values. If the calling application doesn't provide a specific parameter at all, the object will apply the default value to that parameter.

    DO_CLEANUP=>

    Optional. Default value: false

    If given with a true value, the object will try to cleanup some of the parameters given. For instance, if REFERENCE=> is too long, the Tag21 object will truncate it.

    If not given, or if given with a false value, it is fully up to the calling application to assure that the given parameters contain reasonable values.

    REFERENCE=>

    Optional.

    A scalar value that contains a Related Reference for the message. May not be longer than SWIFT::Factory::Tag::Tag21::REF_MAX_LEN.

    If DO_CLEANUP=> was given a true value, then the value given in REFERENCE=> will be truncated if it is too long.

PUBLIC CLASS METHODS

Class methods are always called with the fully qualified name, like:

 print SWIFT::Factory::Tag::Tag21::REF_MAX_LEN();

(The new() constructor is a typical example of a class method.)

REF_MAX_LEN()

Returns the maximum length allowed for the Reference in a TAG21. See also the ref_max_len() object method.

VERSION()

Will return the version of this Perl module. (This method is inherited from the UNIVERSAL class.)

PUBLIC OBJECT METHODS

borken()

A really broken alias for invalid(). Will execute exactly the same code as the invalid() method.

invalid()

Will return the number of errors detected in the objects instance data.

The class can never be charged to guarrantee that the provided string() will be fully compliant with the SWIFT standards or SWIFT verification rules. It can only point out known problems in the object as it is currently loaded.

BETA

Please beware that the current implementation of invalid() doesn't check anything at all. Consider it a placeholder for now. When time permits, the method will be filled with validation code.

Return value:

As it stands, the method will always return zero since it wasn't able to discover any error at all.

provide()

An alias for string(). Will execute exactly the same code as the string() method.

ref_max_len()

Returns the maximum length allowed for the Related Reference in a TAG21. See also the REF_MAX_LEN() class method.

reference()

Get and/or set the Related Reference that will be used when providing the TAG21 string.

Takes one optional parameter, a scalar containing a Related Reference that will be used in all subsequent method calls for this object.

If a Related Reference is provided, it will be stored for future use.

Returns:

If called in a scalar context,

the method will return the Related Reference stored.

If called in an array context,

the method will return an array containing one single value, the Related Reference stored.

If called in void context,

the method will return undef.

string()

Will return a fully formatted string containing a TAG21 for a SWIFT message.

AUTHOR

Gustav Schaffter, <schaffter_cpan@hotmail.com>

COPYRIGHT

Copyright (c) 2003, Gustav Schaffter. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Other Perl modules implementing SWIFT tags in the SWIFT::Factory::Tag::Tagnn family.

Appropriate SWIFT documentation.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 124:

You can't have =items (as at line 133) unless the first thing after the =over is an =item