Changeset 1016

Show
Ignore:
Timestamp:
11/09/07 15:43:54 (10 months ago)
Author:
mikey
Message:

added new interface net.stubbles.reflection.annotations.stubAnnotatable (implements ticket #92)

Files:

Legend:

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

    r940 r1016  
    77 * @subpackage  reflection 
    88 */ 
    9 stubClassLoader::load('net.stubbles.reflection.stubReflectionType'); 
     9stubClassLoader::load('net.stubbles.reflection.annotations.stubAnnotatable', 
     10                      'net.stubbles.reflection.stubReflectionType' 
     11); 
    1012/** 
    1113 * Marker interface for stubReflectionClass and stubReflectionObject. 
     
    1921 * @subpackage  reflection 
    2022 */ 
    21 interface stubBaseReflectionClass extends stubReflectionType 
     23interface stubBaseReflectionClass extends stubReflectionType, stubAnnotatable 
    2224{ 
    23     /** 
    24      * check whether the class has the given annotation or not 
    25      * 
    26      * @param   string  $annotationName 
    27      * @return  bool 
    28      */ 
    29     public function hasAnnotation($annotationName); 
    30  
    31     /** 
    32      * return the specified annotation 
    33      * 
    34      * @param   string          $annotationName 
    35      * @return  stubAnnotation 
    36      * @throws  ReflectionException 
    37      */ 
    38     public function getAnnotation($annotationName); 
    39  
    4025    /** 
    4126     * returns the full qualified class name of the reflected class 
  • trunk/src/main/php/net/stubbles/reflection/stubReflectionFunction.php

    r984 r1016  
    88 * @subpackage  reflection 
    99 */ 
    10 stubClassLoader::load('net.stubbles.reflection.annotations.stubAnnotationFactory', 
     10stubClassLoader::load('net.stubbles.reflection.annotations.stubAnnotatable', 
     11                      'net.stubbles.reflection.annotations.stubAnnotationFactory', 
    1112                      'net.stubbles.reflection.stubReflectionClass', 
    1213                      'net.stubbles.reflection.stubReflectionParameter', 
     
    1920 * @subpackage  reflection 
    2021 */ 
    21 class stubReflectionFunction extends ReflectionFunction 
     22class stubReflectionFunction extends ReflectionFunction implements stubAnnotatable 
    2223{ 
    2324    /** 
     
    3334     */ 
    3435    protected $docComment; 
    35      
     36 
    3637    /** 
    3738     * constructor 
     
    4546        $this->docComment = $this->getDocComment(); 
    4647    } 
    47      
     48 
    4849    /** 
    4950     * check whether the class has the given annotation or not 
     
    5657        return stubAnnotationFactory::has($this->docComment, $annotationName, stubAnnotation::TARGET_FUNCTION, $this->functionName, $this->getFileName()); 
    5758    } 
    58      
     59 
    5960    /** 
    6061     * return the specified annotation 
     
    6869        return stubAnnotationFactory::create($this->docComment, $annotationName, stubAnnotation::TARGET_FUNCTION, $this->functionName, $this->getFileName()); 
    6970    } 
    70      
     71 
    7172    /** 
    7273     * checks whether a value is equal to the class 
     
    8384        return false; 
    8485    } 
    85      
     86 
    8687    /** 
    8788     * returns a string representation of the class 
     
    101102        return 'net.stubbles.reflection.stubReflectionFunction[' . $this->functionName . "()] {\n}\n"; 
    102103    } 
    103      
     104 
    104105    /** 
    105106     * returns a list of all parameters 
  • trunk/src/main/php/net/stubbles/reflection/stubReflectionMethod.php

    r984 r1016  
    88 * @subpackage  reflection 
    99 */ 
    10 stubClassLoader::load('net.stubbles.reflection.annotations.stubAnnotationFactory', 
     10stubClassLoader::load('net.stubbles.reflection.annotations.stubAnnotatable', 
     11                      'net.stubbles.reflection.annotations.stubAnnotationFactory', 
    1112                      'net.stubbles.reflection.stubReflectionClass', 
    1213                      'net.stubbles.reflection.stubReflectionParameter', 
     
    1920 * @subpackage  reflection 
    2021 */ 
    21 class stubReflectionMethod extends ReflectionMethod 
     22class stubReflectionMethod extends ReflectionMethod implements stubAnnotatable 
    2223{ 
    2324    /** 
     
    3940     */ 
    4041    protected $docComment; 
    41      
     42 
    4243    /** 
    4344     * constructor 
     
    5354        $this->docComment = $this->getDocComment(); 
    5455    } 
    55      
     56 
    5657    /** 
    5758     * check whether the class has the given annotation or not 
     
    6465        return stubAnnotationFactory::has($this->docComment, $annotationName, stubAnnotation::TARGET_METHOD, $this->className.'::'.$this->methodName, $this->getFileName()); 
    6566    } 
    66      
     67 
    6768    /** 
    6869     * return the specified annotation 
     
    7677        return stubAnnotationFactory::create($this->docComment, $annotationName, stubAnnotation::TARGET_METHOD, $this->className.'::'.$this->methodName, $this->getFileName()); 
    7778    } 
    78      
     79 
    7980    /** 
    8081     * checks whether a value is equal to the class 
     
    9192        return false; 
    9293    } 
    93      
     94 
    9495    /** 
    9596     * returns a string representation of the class 
     
    109110        return 'net.stubbles.reflection.stubReflectionMethod[' . $this->className . '::' . $this->methodName . "()] {\n}\n"; 
    110111    } 
    111      
     112 
    112113    /** 
    113114     * returns the class that declares this method 
     
    121122        return $stubRefClass; 
    122123    } 
    123      
     124 
    124125    /** 
    125126     * returns a list of all parameters 
  • trunk/src/main/php/net/stubbles/reflection/stubReflectionProperty.php

    r834 r1016  
    88 * @subpackage  reflection 
    99 */ 
    10 stubClassLoader::load('net.stubbles.reflection.annotations.stubAnnotationFactory', 
     10stubClassLoader::load('net.stubbles.reflection.annotations.stubAnnotatable', 
     11                      'net.stubbles.reflection.annotations.stubAnnotationFactory', 
    1112                      'net.stubbles.reflection.stubReflectionClass' 
    1213); 
     
    1718 * @subpackage  reflection 
    1819 */ 
    19 class stubReflectionProperty extends ReflectionProperty 
     20class stubReflectionProperty extends ReflectionProperty implements stubAnnotatable 
    2021{ 
    2122    /** 
     
    5354        $this->docComment = $this->getDocComment(); 
    5455    } 
    55      
     56 
    5657    /** 
    5758     * check whether the class has the given annotation or not 
     
    6465        return stubAnnotationFactory::has($this->docComment, $annotationName, stubAnnotation::TARGET_PROPERTY, $this->className.'::'.$this->propertyName, $this->getDeclaringClass()->getFileName()); 
    6566    } 
    66      
     67 
    6768    /** 
    6869     * return the specified annotation 
     
    7677        return stubAnnotationFactory::create($this->docComment, $annotationName, stubAnnotation::TARGET_PROPERTY, $this->className.'::'.$this->propertyName, $this->getDeclaringClass()->getFileName()); 
    7778    } 
    78      
     79 
    7980    /** 
    8081     * checks whether a value is equal to the class 
     
    9192        return false; 
    9293    } 
    93      
     94 
    9495    /** 
    9596     * returns a string representation of the class 
     
    109110        return 'net.stubbles.reflection.stubReflectionProperty[' . $this->className . '::' . $this->propertyName . "] {\n}\n"; 
    110111    } 
    111      
     112 
    112113    /** 
    113114     * returns the class that declares this parameter