Changeset 445

Show
Ignore:
Timestamp:
03/29/07 22:34:06 (2 years ago)
Author:
schst
Message:

Fixed serialization of boolean values, throw an exception, if @XMLTag and @XMLAttribute are used for the same property/method.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/xml/serializer/stubXMLSerializer.php

    r393 r445  
    8282                } 
    8383                $xmlWriter->writeStartElement($tagName); 
    84                 $xmlWriter->writeText($data === true ? 'true' : false); 
     84                $xmlWriter->writeText($data === true ? 'true' : 'false'); 
    8585                $xmlWriter->writeEndElement(); 
    8686                break; 
     
    144144            $propValue = $property->getValue($object); 
    145145 
     146            if ($property->hasAnnotation('XMLAttribute') && $property->hasAnnotation('XMLTag')) { 
     147                throw new stubXMLException('It is not possible specify @XMLAttribute and @XMLTag for a property.'); 
     148            } 
    146149            if ($property->hasAnnotation('XMLAttribute')) { 
    147150                $xmlAttribute = $property->getAnnotation('XMLAttribute'); 
     
    200203 
    201204            $returnValue = $method->invoke($object); 
     205            if ($method->hasAnnotation('XMLAttribute') && $method->hasAnnotation('XMLTag')) { 
     206                throw new stubXMLException('It is not possible specify @XMLAttribute and @XMLTag for a method.'); 
     207            } 
    202208            if ($method->hasAnnotation('XMLAttribute')) { 
    203209                $xmlAttribute = $method->getAnnotation('XMLAttribute');