Author image Gustav Schaffter

NAME

SWIFT::Factory::Tag::Tag30 - Provides a TAG30 for a SWIFT message

SYNOPSIS

  use SWIFT::Factory::Tag::Tag30;
  my $tag30 = SWIFT::Factory::Tag::Tag30->new();

DESCRIPTION

This class provides a TAG30 for SWIFT messages. TAG30 is used for

The class is also used as a base class for other TAGnn classes, for instance TAG30T and TAG30V.

CONSTRUCTOR

new( DO_CLEANUP=>1, YEAR=>3, MONTH=>2, DAY=>23 );

    Instantiates a new Tag30 object.

    The parameters may be given in arbitrary order. All 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.

    Note that the default values may be invalid in a SWIFT message.

    DO_CLEANUP=>

    Optional scalar value. Default value: false

    If given with a true value, the object will try to cleanup some of the parameters given. For instance, if the value given in YEAR=> is too long, the Tag30 object will truncate it to the length returned by SWIFT::Factory::Tag::Tag30->FIGURES_IN_YEAR().

    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.

    YEAR=>

    Technically optional but logically required. A numeric scalar value that will be part of the date in TAG30.

    Default value: 0 (zero). Beware that the default value is valid in a SWIFT message, but may not be what you want to send to the receiver.

    If DO_CLEANUP=> was given a true value, then the value given in YEAR=> will be truncated if it is longer than what is returned by SWIFT::Factory::Tag::Tag30->FIGURES_IN_YEAR().

    Any truncation of the Year happens to the 'left'. When provided by the string() and provide() methods, the Year will always be formatted to the length of SWIFT::Factory::Tag::Tag30->FIGURES_IN_YEAR().

    Be aware that other classes derives from this class. In those instances, SWIFT::Factory::Tag::Tag30->FIGURES_IN_YEAR() will potentially return a different value than what is returned from this class.

    MONTH=>

    Technically optional but logically required. Default value: 0 (zero). Beware that the default value is invalid in a SWIFT message.

    A numeric scalar value that will be part of the value date in TAG30. Valid values are 1 - 12, inclusive.

    DAY=>

    Technically optional but logically required. Default value: 0 (zero). Beware that the default value is invalid in a SWIFT message.

    A numeric scalar value that will be part of the value date in TAG30T. Valid values are 1 - 31, inclusive.

PUBLIC CLASS METHODS

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

 print SWIFT::Factory::Tag::Tag30->VERSION();

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

VERSION()

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

TAG_ID()

This method is probably never called by an application.

The method is primarily provided to be overridden by classes inheriting from SWIFT::Factory::Tag::Tag30, like for instance TAG30T and TAG30V.

The TAG30 class returns nothing but a zero length string.

FIGURES_IN_YEAR()

Returns a numeric scalar value indicating how many figures will be used when formatting the Year in the date provided by this class.

The application should preferrably never provide a YEAR=> value containing more figures than the value returned by this method.

The provide() and string() methods will always format the Year of the Date to this many figures.

This method will typically be overridden by any class inheriting from this class, for instance the Tag30T and Tag30V classes.

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.

string()

Will return a fully formatted string containing a TAG30 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 110:

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