1 | <?php |
||
34 | class Route extends ReflectionAnnotation |
||
35 | { |
||
36 | |||
37 | /** |
||
38 | * The annotation to define a servlets routing. |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | const ANNOTATION = 'Route'; |
||
43 | |||
44 | /** |
||
45 | * The constructor the initializes the instance with the |
||
46 | * data passed with the token. |
||
47 | * |
||
48 | * @param string $annotationName The annotation name |
||
49 | * @param array $values The annotation values |
||
50 | */ |
||
51 | 1 | public function __construct($annotationName, array $values = array()) |
|
52 | { |
||
53 | |||
54 | // pass values to parent constructor |
||
55 | 1 | parent::__construct($annotationName, $values); |
|
56 | |||
57 | // initialize the URL pattern values |
||
58 | 1 | if (!isset($this->values[AnnotationKeys::URL_PATTERN])) { |
|
59 | $this->values[AnnotationKeys::URL_PATTERN] = array(); |
||
60 | } |
||
61 | |||
62 | // initialize the initialization parameter values |
||
63 | 1 | if (!isset($this->values[AnnotationKeys::INIT_PARAMS])) { |
|
64 | $this->values[AnnotationKeys::INIT_PARAMS] = array(); |
||
65 | } |
||
66 | 1 | } |
|
67 | |||
68 | /** |
||
69 | * This method returns the class name as |
||
70 | * a string. |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | public static function __getClass() |
||
78 | |||
79 | /** |
||
80 | * Returns the value of the name attribute. |
||
81 | * |
||
82 | * @return string The annotations name attribute |
||
83 | */ |
||
84 | 1 | public function getName() |
|
88 | |||
89 | /** |
||
90 | * Returns the value of the displayName attribute. |
||
91 | * |
||
92 | * @return string The annotations displayName attribute |
||
93 | */ |
||
94 | 1 | public function getDisplayName() |
|
98 | |||
99 | /** |
||
100 | * Returns the value of the description attribute. |
||
101 | * |
||
102 | * @return string The annotations description attribute |
||
103 | */ |
||
104 | 1 | public function getDescription() |
|
108 | |||
109 | /** |
||
110 | * Returns the URL patterns the servlet is mapped to. |
||
111 | * |
||
112 | * @return array The URL patterns |
||
113 | */ |
||
114 | 1 | public function getUrlPattern() |
|
118 | |||
119 | /** |
||
120 | * Returns the URL initialization parameters the servlet is mapped to. |
||
121 | * |
||
122 | * @return array The initialization parameters |
||
123 | */ |
||
124 | 1 | public function getInitParams() |
|
128 | } |
||
129 |