Changeset 940

Show
Ignore:
Timestamp:
09/25/07 23:15:22 (1 year ago)
Author:
mikey
Message:

finished reflection type

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/reflection/stubBaseReflectionClass.php

    r883 r940  
    77 * @subpackage  reflection 
    88 */ 
     9stubClassLoader::load('net.stubbles.reflection.stubReflectionType'); 
    910/** 
    1011 * Marker interface for stubReflectionClass and stubReflectionObject. 
     
    1819 * @subpackage  reflection 
    1920 */ 
    20 interface stubBaseReflectionClass 
     21interface stubBaseReflectionClass extends stubReflectionType 
    2122{ 
    2223    /** 
     
    3637     */ 
    3738    public function getAnnotation($annotationName); 
    38  
    39     /** 
    40      * checks whether a value is equal to the class 
    41      * 
    42      * @param   mixed  $compare 
    43      * @return  bool 
    44      */ 
    45     public function equals($compare); 
    4639 
    4740    /** 
  • trunk/src/main/php/net/stubbles/reflection/stubReflectionClass.php

    r834 r940  
    265265        return $refPackage; 
    266266    } 
     267 
     268    /** 
     269     * checks whether the type is an object 
     270     * 
     271     * @return  bool 
     272     */ 
     273    public function isObject() 
     274    { 
     275        return true; 
     276    } 
     277 
     278    /** 
     279     * checks whether the type is a primitive 
     280     * 
     281     * @return  bool 
     282     */ 
     283    public function isPrimitive() 
     284    { 
     285        return false; 
     286    } 
    267287} 
    268288?> 
  • trunk/src/main/php/net/stubbles/reflection/stubReflectionObject.php

    r834 r940  
    286286        return $refPackage; 
    287287    } 
     288 
     289    /** 
     290     * checks whether the type is an object 
     291     * 
     292     * @return  bool 
     293     */ 
     294    public function isObject() 
     295    { 
     296        return true; 
     297    } 
     298 
     299    /** 
     300     * checks whether the type is a primitive 
     301     * 
     302     * @return  bool 
     303     */ 
     304    public function isPrimitive() 
     305    { 
     306        return false; 
     307    } 
    288308} 
    289309?> 
  • trunk/src/main/php/net/stubbles/reflection/stubReflectionPrimitive.php

    r934 r940  
    77 * @subpackage  reflection 
    88 */ 
    9 stubClassLoader::load('net.stubbles.reflection.stubReflectionType'); 
     9stubClassLoader::load('net.stubbles.lang.stubEnum', 
     10                      'net.stubbles.reflection.stubReflectionType' 
     11); 
    1012/** 
    1113 * Type reference for primitives. 
     
    98100 
    99101    /** 
     102     * returns the name of the type 
     103     * 
     104     * @return  string 
     105     */ 
     106    public function getName() 
     107    { 
     108        return $this->name(); 
     109    } 
     110 
     111    /** 
    100112     * checks whether the type is an object 
    101113     * 
     
    139151    public function __toString() 
    140152    { 
    141         return 'net.stubbles.reflection.stubReflectionPrimitive[' . $this->name . "] {\n}\n"; 
     153        return 'net.stubbles.reflection.stubReflectionPrimitive[' . $this->value . "] {\n}\n"; 
    142154    } 
    143155} 
  • trunk/src/test/php/net/stubbles/reflection/ReflectionTestSuite.php

    r698 r940  
    4646        $this->addTestFile(dirname(__FILE__) . '/stubReflectionParameterTestCase.php'); 
    4747        $this->addTestFile(dirname(__FILE__) . '/stubReflectionPropertyTestCase.php'); 
     48        $this->addTestFile(dirname(__FILE__) . '/stubReflectionPrimitiveTestCase.php'); 
    4849    } 
    4950}