View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Jeff Nokes > eBay-API-0.22 > eBay::API::XML::BaseDataType



Annotate this POD


New  3
Open  0
View/Report Bugs
Module Version: 0.01   Source   Latest Release: eBay-API-0.25

Subroutines: ^





   1. rhXmlSimple    - Data structure created by parsing an XML str with

   2. recursionLevel - Level of recursion, this is an optional argument
                       and it is used for debuging purposes only. 
                       If constant DISPLAY_RECURSION is set to 1, 
                       recursionLevel is used to pretty print the output
                       tracing the recursion.

   3. sRawXmlString  - XML string used to set objects properties. The string is
                       first parsed by XML::Simple. Data structure that is 
                       received after parsing is used to populate object's
                       properties (it overrides 'rhXmlSimple' parameter). 
                       'sRawXmlString' parameter should be used for test 
                       purposes only!!


Access level: private

1. 'xs:boolean'

XML schema API calls for boolean values return 'true' and 'false'. During deserilization we convert API boolean values to perl's boolean values:

    1 (true) and 0 (false).

2. XML:Simple parses empty tags into a hash reference?!?! <Location> </Location> converted into 'Location' => {}


Some DataType setters set reference to an array and this function is used in such setters to convert passed paremeter to 'a reference to an array' if one is not passed.


     DataType: has 'setFee' setter. This setter expects 
               a reference to an array to be passed.

Still, we will support 3 types of parameters:

  1. parameter is a reference to an array, no conversion (just as should be)

  2. parameter is an array, convert it to a reference to an array

  3. parameter is a scalar, create an array with one element and
         then create a reference to that array

This method is used in setters that expect a parameter of 'a reference to an array' type

The generated setters look like the following one:

 sub setProperty {
    my $self = shift;
    $self->{'property'} = $self->convertArray_To_RefToArrayIfNeeded(@_);


Used in getters that return a BaseDataType object. If the object is not defined, it instantiate it.

This allows the following syntax:

     my $sSellerId = $pItem->getSeller()->getUserID();

Otherwise we would have to write something like this:

     my $pSeller = $pItem->getSeller();
     if ( defined $pSeller ) {
        $SellerId = $pSeller->getUserID();


Used in getters that return an array.

If the array is not defined instantiate it.

Internally all arrays are stored as references to an array. Depending on calling context, this method returns either an array or a reference to an array, which means we can use both of the following syntaxes:

 my $ra = $pType->_getDataTypeArray();  # returns a ref to an array
 my @a = $pType->_getDataTypeArray();   # returns an array



        1 - If hash containing object properties is empty.

        0 - If hash conatining object properties is not empty

Basically this means that:

        "scalar (keys @$self )" returns 0

        or "scalar %$self" returns 1
syntax highlighting: